Text-to-Video v1 (legacy)
Overview
The Luma AI Dream Machine API allows developers to generate, retrieve, and extend AI-generated content using a variety of inputs. This API is particularly useful for creative applications, such as generating visual content from text prompts.
Each generation costs 500 000 Apilaplas Tokens.
Setup your API Key
If you donβt have an API key for the Apilaplas API yet, feel free to use our Quickstart guide.
How to Make a Call
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.
Below, you can find three corresponding API schemas and examples for all endpoint calls.
API Schemas
Generate Video
Example
import requests
url = "https://api.apilaplas.com/luma-ai/generations"
payload = {
"aspect_ratio": "16:9",
"expand_prompt": True,
"user_prompt": "Flying jellyfish"
}
headers = {
"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Fetch Generations
Example
import requests
url = "https://api.apilaplas.com/luma-ai/generation"
querystring = {"ids[0]":"4c9126f3-d9a6-4eaf-aa4c-b64b634f65bd"}
headers = {
"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>",
"content-type": "application/json"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
Extend Video
Extend allows you to effortlessly add length to an existing video.
Example
import requests
url = "https://api.apilaplas.com/luma-ai/generations/57a6cb80-6da0-49bd-b29a-3f089b9e55e4/extend"
payload = {
"aspect_ratio": "16:9",
"expand_prompt": True,
"user_prompt": "Flying jellyfish with a hat"
}
headers = {
"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Last updated