Seedance 2.5 from ByteDance is officially available on Apiframe.

Luma API Guide: Features, Pricing & Code (2026)

Luma Dream Machine API explained: features, real pricing, and working code for video.

Janice Last updated November 5, 2026 July 10, 2026 · 7 min read Beginner
Luma API Guide: Features, Pricing & Code (2026)

Luma AI's Dream Machine is one of the more visually distinctive AI video tools out there, known for realistic lighting and smooth camera motion. Before you start integrating, there is one thing worth knowing upfront: the consumer app and the developer API are not always running the same model version. This guide covers what is actually available to developers today, not just what you see in the web app.

What Is the Luma Dream Machine API?

Dream Machine is Luma's video generation platform, built on Luma's Ray series of models. On the consumer web app, Luma has moved fast: Ray3 shipped in September 2025 as what Luma called the first "reasoning" video model, able to plan a shot before rendering it. Ray3.14 followed in January 2026 as the cheaper, faster everyday option, and Ray3.2 arrived on June 9, 2026, adding frame-by-frame control and other production features.

The developer-facing Dream Machine API, at api.lumalabs.ai, is a separate product with its own version numbers, and for most of the past year it ran behind the consumer app. It offered only Ray 2 and Ray 2 Flash, through a single /generations endpoint. That gap closed in June 2026, when Luma opened up Ray3.2 through a new product called the Luma Agents API. It gives you the full set of Ray3.2 controls (up to 16 keyframes in a single clip, HDR output for a wider range of brightness and color, and 16-bit EXR export for professional color work) alongside an image model called Uni-1, since updated to Uni-1.1. It is a separate integration from the Dream Machine API this guide covers, with its own keys, its own billing, and its own request format.

This guide focuses on the original Dream Machine API (Ray 2 and Ray 2 Flash), since that is still what most existing integrations, including Apiframe's, are built on. If Ray3.2's keyframe control and HDR output are specifically what you are after, go to the Luma Agents API directly. The rest of this guide does not apply there.

Ray 2 is still a capable model in its own right. Text-to-video, image-to-video, start and end frames, extending a clip, looping, and camera motion control are all supported. One thing it does not do is generate sound, so if your project needs synchronized audio you will want a model like Kling or Veo instead. If you are weighing several video models at once, our comparison of the best AI video generation APIs is a good place to start, and our complete AI video API guide covers the concepts that apply across all of them.

Key Features

Ray 2 Video Generation

Ray 2 generates 5 or 9 second clips, at 540p, 720p, 1080p, or 4K. The API defaults to 720p unless you ask for something else, so set the resolution explicitly if you need more. Camera motion is handled through a concepts parameter, a library of named camera moves (pan, orbit, dolly zoom, aerial, handheld, and dozens more) that you attach to the request. That is usually more reliable than describing the camera move in words and hoping the model picks it up.

Text-to-Video and Image-to-Video Modes

You can generate from a text prompt alone, or pin the generation to a start image, an end image, or both. Luma calls these keyframes, and they are useful for moving between two specific scenes or bringing a still product photo to life. Ray 2 can also continue an existing clip forward or backward in time, and fill in the motion between two separate generations. Our image-to-video Python tutorial walks through that workflow end to end, and for tips on keeping the same subject recognizable across clips, see our guide on keeping AI-generated characters consistent.

Luma API Pricing

There are three separate things called "Luma pricing," and mixing them up is where most of the confusion comes from.

Dream Machine web app (consumer): the free tier gives roughly 80 credits per day, enough for about one short clip every 24 hours, capped at 720p, watermarked, and unused credits do not carry over to the next day. Paid consumer plans start around $30 a month and run up to several hundred for the top individual tiers. Tier names and prices shift fairly often, so treat these as rough figures and check Luma's own pricing page for the current lineup.

Developer API (Dream Machine, Ray 2 and Ray 2 Flash): web app credits do not carry over here. This API is billed separately, charged per generation as you go, with reported per-clip pricing around $0.60 for a 5-second Ray 2 Flash clip at 720p, up to roughly $0.95 to $1.05 for a 5-second Ray 2 clip at higher resolutions. Confirm current rates on your own billing dashboard, since per-model pricing gets adjusted as new versions roll out. For a wider view of how video pricing compares across providers, our AI video API pricing breakdown covers per-second costs across the market.

Luma Agents API (Ray3.2), a separate product: priced by the second rather than by the clip, and it scales with resolution and picture quality. As of this writing, a standard 5-second generation runs about $0.30 at 720p and about $1.20 at 1080p, with HDR output priced at roughly twice the standard rate and HDR plus EXR at roughly three times. There is also a reserved-capacity tier for production workloads that need guaranteed throughput and a response-time commitment, billed monthly rather than per generation.

If you are trying to work out what any of this means at your expected volume rather than per clip, our guide to estimating monthly AI video costs shows how to build the arithmetic before you commit.

Getting Started: Official API Setup

  • Create an account and generate a key at platform.lumalabs.ai.
  • Pass the key as a Bearer token in the Authorization header on every request.
  • The base URL is https://api.lumalabs.ai/dream-machine/v1.

A minimal request to Luma directly looks like this. Note that duration here is a string with a unit, not a number.

bash
curl --request POST \
  --url https://api.lumalabs.ai/dream-machine/v1/generations \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR_LUMA_API_KEY' \
  --header 'content-type: application/json' \
  --data '{
    "prompt": "a cinematic aerial shot over a misty mountain range at sunrise",
    "model": "ray-2",
    "resolution": "720p",
    "duration": "5s"
  }'

Official API vs. Apiframe Access

For the original Dream Machine API covered here, Luma directly and Apiframe run the same models: Ray 2 and Ray 2 Flash. So the choice is not about which one gets you a newer model. Going direct means a dedicated key, its own billing dashboard, and its own request and response format to build around. Going through a single API gets you the same two models alongside Kling, Hailuo, Seedance, Runway, Veo, and others under one key, one credit balance, and one pattern for every job (POST /v2/videos/generate, then check GET /v2/jobs/:id). Our Kling 3.0 guide and Runway API guide cover setup for two of those if you want to compare.

On price, the two are close but not identical, and which is cheaper depends on the model. Ray 2 Flash works out cheaper through Apiframe (44 credits, or $0.44, for 5 seconds against roughly $0.60 direct), while standard Ray 2 costs a little more (131 credits, or $1.31, against roughly $0.95 to $1.05 direct). If you are running one model at very high volume, it is worth doing that arithmetic for your own mix.

The consistency matters most if your product needs more than one video model, since you are not maintaining separate keys, request formats, and response formats for each provider. One caveat worth flagging: if Ray3.2's newer capabilities (multi-keyframe direction, HDR, EXR export) are specifically what you need, that model currently lives only on Luma's separate Agents API, and Apiframe does not offer it yet. Going direct to Luma is your only option there for now.

How to Call the Luma API: Code Example

Here is a full round trip through Apiframe. The idea is the same as the direct request above, a prompt plus a model and some settings, but the model-specific options move into a lumaParams object and you get back a job to check on rather than waiting on the connection.

python
import requests
import time

API_KEY = "afk_your_api_key_here"
BASE_URL = "https://api.apiframe.ai/v2"

headers = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json",
}

# 1. Submit the generation request
payload = {
    "prompt": "a cinematic aerial shot over a misty mountain range at sunrise",
    "model": "luma-ray-2",
    "lumaParams": {
        "duration": 5,
        "aspect_ratio": "16:9",
    },
}

response = requests.post(f"{BASE_URL}/videos/generate", headers=headers, json=payload)
response.raise_for_status()
job_id = response.json()["jobId"]
print(f"Job submitted: {job_id}")

# 2. Check the job until it finishes
while True:
    job = requests.get(f"{BASE_URL}/jobs/{job_id}", headers=headers).json()

    if job["status"] == "COMPLETED":
        print("Video ready:", job["result"]["videoUrl"])
        break
    elif job["status"] == "FAILED":
        print("Generation failed:", job.get("error"))
        break

    time.sleep(5)

Checking in a loop is fine while you are testing, but it leaves your code waiting around for a minute or more. In production, send a callback URL with the request and Apiframe will notify your server the moment the clip is ready. Our walkthrough on setting up callbacks covers that, and our text-to-video Python tutorial builds the same flow into a proper service with error handling.

On credits, luma-ray-2 costs 131 credits ($1.31) for a 5-second clip and 235 ($2.35) for 9 seconds. luma-ray-flash-2 runs 44 credits ($0.44) for 5 seconds and 78 ($0.78) for 9, roughly a third of the standard model, which matches Luma's own pricing where Flash is the cheaper, faster option. Start with Flash while you are iterating on prompts and switch to standard Ray 2 once you know what you want.

Use Cases

Ray 2's strengths (realistic lighting, smooth camera moves, and motion that holds together) suit a handful of practical jobs: short marketing clips with no dialogue, product footage generated from a still photo, social content where a few seconds of polished motion beats a static image, and rough previews of a scene before committing budget to a real shoot. Since Ray 2 generates no sound, anything that needs speech or synced music will need audio added separately. For the product photo workflow, our AI product photography API guide covers the image side, and our roundup of the best image-to-video APIs compares Ray 2 against other options built for the same task.

Ray 2's 9-second ceiling is short compared to some alternatives, so if clip length is the constraint, our Seedance 2.5 guide covers a model that handles 30 seconds in a single pass. For scenes built around people, where natural body movement and facial expression carry the shot, our Hailuo 2.3 guide covers the stronger option there.

FAQ

Is there a genuinely free tier?

On the consumer web app, yes: about 80 credits per day, resetting daily, capped at 720p with a watermark. The developer Dream Machine API has no equivalent. It is pay as you go from the first request. Our post on what is actually free in AI video generation covers how the other providers compare on this.

How long does a generation take?

It varies with load and clip length, generally tens of seconds to a couple of minutes for a 5 to 9 second clip. Flash is the faster of the two. Check the job status rather than assuming a fixed time.

What resolutions and durations are supported?

Through the developer Dream Machine API, Ray 2 supports 540p, 720p, 1080p, and 4K, in 5 or 9 second clips. The default is 720p if you do not specify.

Does it support image-to-video?

Yes, using the keyframes parameter with a frame0 (start image), a frame1 (end image), or both.

Does Ray 2 generate audio?

No. Ray 2 output is silent, so sound has to be added afterwards. If synchronized audio is a requirement, look at Kling or Veo instead, both of which generate sound alongside the picture. If you are weighing Luma against Kling or Hailuo for the same project, Apiframe's model pages let you compare parameters and credit costs side by side before you commit. New Apiframe accounts come with 100 free credits, which covers two 5-second Ray 2 Flash clips, enough to judge the look before you spend anything. Standard Ray 2 costs more than that per clip, so start with Flash. Our getting started guide covers signup and your first call.

Power your next AI product with Apiframe.

Instant access to 70+ media models through a single API. Start free and scale when you're ready.