Application and Usage
To use the Luma Videos API, you can first visit the Luma Videos Generation API page and click the “Acquire” button to obtain the credentials needed for the request:
If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.
Upon the first application, there will be a free quota provided, allowing you to use the API for free.
Basic Usage
To generate a video, you can input any text. For example, if I want to generate a video about astronauts shuttling between space and volcanoes, I can inputAstronauts shuttle from space to volcano, as shown in the image:


prompt: The prompt for generating the video.aspect_ratio: The aspect ratio of the video, default is 16:9.end_image_url: Optional, specifies the end frame.enhancement: Optional, clarity enhancement switch.loop: Whether to generate a looping video, default is false.timeout: Optional, timeout in seconds.callback_url: Asynchronous callback address.
- success: Whether the generation was successful; if successful, it is
true, otherwise it isfalse. - task_id: The unique ID of this video generation task.
- video_id: The unique ID of the video generated from this task.
- prompt: The keywords for this video generation task.
- video_url: The result video link of this video generation task.
- video_height: The height of the generated video thumbnail image.
- video_width: The width of the generated video thumbnail image.
- state: The status of this video generation task; if the task is completed, it is
completed. - thumbnail_url: The link to the generated video thumbnail image.
- thumbnail_width: The width of the generated video thumbnail image.
- thumbnail_height: The height of the generated video thumbnail image.
Custom Start and End Frame Generation
If you want to generate a video by customizing the start and end frames, you can input the image links for the start and end frames: At this point, the video start framestart_image_url field can accept the following image as the start frame of the video:
Next, we need to customize the video generation based on the start and end frames and keywords, specifying the following content:
- action: The action of the video generation task, usually normal generation
generateand extended generationextend, default isgenerate. - start_image_url: Specifies the start frame of the generated video.
- end_image_url: Specifies the end frame of the generated video.
- prompt: The keyword content for generating the video.


An example of the input is as follows:

Video Extension Functionality
If you want to continue generating the video, you can set the parameteraction to extend, and input the ID or video link of the video you want to continue generating. The video ID and video link can be obtained based on the basic usage, as shown in the image below:

Note that theTo continue generating the video, you must upload the video link or video ID. Below is a demonstration of using the video ID to extend it. Next, we must fill in the keywords to customize the video generation, specifying the following content:video_idandvideo_urlhere are the ID and link of the generated video. If you do not know how to generate a video, you can refer to the basic usage above to generate a video.
- action: The action for extending the video, which should be
extend. - prompt: The keywords for extending the video.
- video_url: The link to the video that needs to be extended.
- video_id: The unique ID of the video that needs to be extended.
- end_image_url: The link to the image for the last frame of the extended video, optional parameter.



Next, we will add the last frame image information based on the above, as shown below:

Asynchronous Callback
Since the time for Luma to generate videos is relatively long, approximately 1-2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, leading to additional system resource consumption. Therefore, this API also provides support for asynchronous callbacks. The overall process is: when the client initiates a request, an additionalcallback_url field is specified. After the client makes the API request, the API will immediately return a result containing a task_id field, representing the current task ID. When the task is completed, the generated music result will be sent to the client-specified callback_url in the form of a POST JSON, which also includes the task_id field, allowing the task result to be associated by ID.
Next, let’s understand how to operate specifically through an example.
First, the Webhook callback is a service that can receive HTTP requests, and developers should replace it with the URL of their own HTTP server. For demonstration purposes, we will use a public Webhook sample site https://webhook.site/, and opening this site will provide a Webhook URL, as shown in the image:

callback_url field to the above Webhook URL and fill in the prompt, as shown in the image:

The content is as follows:
task_id field, and the other fields are similar to those mentioned above, allowing the task to be associated through this field.
