Skip to main content

FLUX 3 Max API Tutorial: Text-to-Video, Image-to-Video and Keyframes in Python

Every parameter, the 24 fps keyframe math, measured timings and per-second pricing for the fast FLUX 3 Video variant

Updated 6 min readMarkdown

FLUX 3 Max is a video generation model from the FLUX family by Black Forest Labs: a post-trained, latency-optimized variant of FLUX 3 Video that makes 5 to 20 second clips at 720p or 1080p, with optional generated audio, from a text prompt, a starting image, or up to 10 keyframe images. This guide shows how to call all three modes from Python, how the keyframe positions are calculated, and what it costs per second.

Disclosure up front: the code, timings and prices below come from apimodels.app, the multi-model API I work on, where FLUX 3 Max is available as the model id flux-3-max.

What FLUX 3 Max is good at

The headline is speed. The model's publisher reports a 10-second video in about 11 seconds in its own benchmark (against 277.8 seconds for Seedance 2.5), and joint first place in a preliminary Artificial Analysis image-to-video evaluation. Treat both as the publisher's numbers; preliminary rankings move as votes come in.

Our own spot checks on 20 October 2026, one run per mode, 720p, 5 seconds, reasoning_level: "low", timed from the create request to a downloadable file:

Mode Input Ready in Output
Text-to-video Prompt only, 16:9 9 s 1280×704, 24 fps, with audio
Image-to-video Square product photo 15 s 960×960, follows the image, with audio
Keyframes-to-video 2 images at 0 s and 5 s, audio off 19 s 960×960, no audio track

One run per mode is a spot check, not a benchmark. reasoning_level: "high" (the default) spends more time on the prompt.

One endpoint, three modes

All three modes share one model id and one endpoint. What you send decides the mode:

  • Text-to-video: prompt only.
  • Image-to-video: add first_frame_url; optionally last_frame_url to guide the final frame.
  • Keyframes-to-video: send a keyframes array instead of first/last frame.

Shared parameters:

Parameter Values Default
duration 5 to 20 whole seconds 5
resolution 720p, 1080p 720p
aspect_ratio auto, 21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16 auto (16:9 for text, follows the first image otherwise)
generate_audio true, false true
reasoning_level low, high high
seed integer random

Reference videos, reference audio and multiple loose reference images are not accepted; you get a 400 that says so instead of a silently ignored file.

Text-to-video in Python

The API is asynchronous: create a task, then poll until it is done.

import time, requests

API = "https://api.apimodels.app/v1/video/generations"
H = {"Authorization": "Bearer YOUR_API_KEY"}

def wait(task_id):
    while True:
        d = requests.get(API, headers=H, params={"task_id": task_id}).json()["data"]
        if d["state"] == "completed":
            return d["resultUrls"][0]
        if d["state"] == "failed":
            raise RuntimeError(d["failMsg"])
        time.sleep(3)

task = requests.post(API, headers=H, json={
    "model": "flux-3-max",
    "prompt": "A red paper boat drifts down a rain-soaked city gutter at dusk, "
              "neon reflections ripple on the water, camera follows at street level, soft rain sounds",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "reasoning_level": "low",
}).json()["data"]["taskId"]

print(wait(task))

Describe sound in the prompt ("soft rain sounds") and the generated audio follows it. Set generate_audio: False when you will add your own soundtrack.

Image-to-video with a first and last frame

The first image sets the opening composition; the prompt directs what changes after it. You do not need to repeat everything that is visible in the image.

task = requests.post(API, headers=H, json={
    "model": "flux-3-max",
    "prompt": "The camera slowly moves closer as the mug turns on the table, "
              "thin steam rises, quiet kitchen ambience",
    "first_frame_url": "https://example.com/first.jpg",
    "last_frame_url": "https://example.com/last.jpg",  # optional
    "duration": 8,
    "resolution": "1080p",
}).json()["data"]["taskId"]

With aspect_ratio left at auto, the output follows the first image: a square photo gives a square video.

Keyframes-to-video: the frame math

Keyframes pin 1 to 10 images to positions in the clip, and the model builds the motion between them. Each keyframe is {image_url, frame_index}, where frame_index is a frame number in the 24 fps output:

  • frame 0 is the first frame
  • frame duration × 24 is the last one, so a 5-second clip ends at frame 120 and a 20-second clip at frame 480
  • every position must be unique

apimodels.app also accepts {image_url, time} in seconds and converts it with round(time × 24), which is easier to reason about:

task = requests.post(API, headers=H, json={
    "model": "flux-3-max",
    "prompt": "A smooth cinematic transition from a casual kitchen snapshot "
              "to a premium studio product shot, light sweeps across the product",
    "duration": 6,
    "keyframes": [
        {"image_url": "https://example.com/start.jpg", "time": 0},          # frame 0
        {"image_url": "https://example.com/middle.jpg", "frame_index": 72},  # 3 s
        {"image_url": "https://example.com/end.jpg", "time": 6},            # frame 144
    ],
    "generate_audio": False,
}).json()["data"]["taskId"]

Keyframes cannot be combined with first_frame_url or last_frame_url. To lock both ends, put those two images into the array at 0 and at the clip length.

Pricing

On apimodels.app FLUX 3 Max is billed per second of video: $0.221 per second at 720p and $0.377 per second at 1080p, the same for all three modes. A 5-second 720p clip is $1.105; a 10-second 1080p clip is $3.77. Until 00:00 UTC on 7 November 2026 there is a special price of $0.085 per second (720p) and $0.145 per second (1080p). Only successful generations are charged.

When FLUX 3 Max is not the right model

  • You need more than 20 seconds in one pass, many reference images to keep a character consistent, or editing and extending an existing video: Seedance 2.5 covers those (up to 30 seconds and 50 reference assets, at 480p or 720p).
  • You need 4K output or a reference video for motion transfer.
  • You only need rough drafts at the lowest possible spend per second.

FAQ

How do I get the result without polling? Pass callback_url when you create the task; the finished result is POSTed to that URL.

Does audio cost extra? No. Audio is on by default and does not change the price.

Can I use the same key for other video models? Yes. On apimodels.app the same key and balance cover Seedance, Kling, Veo, MiniMax H3 and 140+ other models; switching is a change of the model field.

The full parameter reference, pricing table and a comparison with Seedance 2.5, Kling V3 and Veo 3.1 are in the FLUX 3 Max API guide on apimodels.app.

Drafted with AI assistance; the timings and prices come from our own test runs on 20 October 2026.

No comments yet. Be the first to comment.