Luma Ray 1.6 (Text-to-Video)

circle-info

This documentation is valid for the following list of our models:

  • luma/ray-1-6

Overview

The Luma AI Dream Machine API allows developers to generate and extend AI-generated videos based on text prompts.

Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guidearrow-up-right.

How to Make a Call

chevron-rightStep-by-Step Instructionshashtag

Generating a video using this model involves making two sequential API calls:

  • The first one is for creating and sending a video generation task to the server (returns a generation ID). This can be either a generation from a reference image/prompt or a video extension operation that adds length to an existing video.

  • The second one is for requesting the generated or extended video from the server using the generation ID received from the first endpoint. Within this API call, you can use either the standard endpoint to retrieve the generated/extended video or a special endpoint to request multiple generations at once.

Below, you can find three corresponding API schemas and examples for all endpoint calls.

API Schemas

Generate video

loop parameter controls if the generated video will be looped.

post
Body
modelstring · enumRequiredPossible values:
promptstringRequired

The text description of the scene, subject, or action to generate in the video.

aspect_ratiostring · enumOptional

The aspect ratio of the generated video.

Default: 16:9Possible values:
loopbooleanOptional

Whether to loop the video

Default: false
Responses
chevron-right
200Success
application/json
post
/v2/video/generations
200Success

Fetch generation

After sending a request for video generation, this task is added to the queue. This endpoint lets you check the status of a video generation task using its id, obtained from the endpoint described above. If the video generation task status is completed, the response will include the final result — with the generated video URL and additional metadata.

get
Authorizations
AuthorizationstringRequired

Bearer key

Query parameters
generation_idstringRequiredExample: <REPLACE_WITH_YOUR_GENERATION_ID>
Responses
chevron-right
200Success
application/json
get
/v2/video/generations
200Success

Example: Fetch Single Generation

For example, if you are waiting for video dreaming (when the video is popped from the queue and generation is in processing), then you can send the following request:

Fetch Multiple Generations

Instead of using the generation_id parameter, you will pass generation_ids, which can be an array of IDs. This parameter can also accept IDs separated by commas.

get
Authorizations
AuthorizationstringRequired

Bearer key

Query parameters
generation_idsany ofRequired
string · uuid[] · min: 1Optional
or
stringOptional
statusstringOptional
Responses
chevron-right
200Success

No content

get
/v2/generate/video/luma-ai/generations
200Success

No content

Example: Fetch Multiple Generations

Example: Fetch Multiple Generations

circle-info

Ensure you replace <YOUR_AIMLAPI_KEY> with your actual API key before running the code.

Extend video

You can extend a video using an existing video you generated before (using its generation ID) or by using an image (via URL). The extension can be done by appending to or prepending from the original content.

The keywords parameter controls the following extensions. It can include parameters for defining frames:

  • first frame (frame0)

  • last frame (frame1)

For example, if you want to use an image as a reference for a frame:

Or, in the case of using a previously generated video:

post
Authorizations
AuthorizationstringRequired

Bearer key

Body
generation_typestring · enum | nullableOptionalPossible values:
promptstringRequired
aspect_ratiostring · enumOptionalPossible values:
loopbooleanOptionalDefault: false
callback_urlstring · uri | nullableOptional
modelstring · enumOptionalDefault: ray-2Possible values:
resolutionstring · enum | nullableOptionalPossible values:
durationstring · enum | nullableOptionalPossible values:
Responses
post
/v2/generate/video/luma-ai/generation
201Success

No content

Examples

circle-exclamation

Extension with the Image

Extension with the Generation

Last updated

Was this helpful?