The Luma AI connector lets your AI agent act in each user's Luma AI account. Each user connects their own Luma AI access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 14 tools.
- Tools
- 14
- What they doRead · write · destructive
- 5 · 8 · 15 read8 write1 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Luma AI connection
In AgentKit > Connections, create a Luma AI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'lumalabs'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Luma AI:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'lumalabs_get_credits',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "lumalabs"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Luma AI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="lumalabs_get_credits",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Luma AI credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toollumalabs_get_creditsGet the remaining credit balance of the Luma AI account behind this API key.Read-onlyGet Credits
Get the remaining credit balance of the Luma AI account behind this API key. Returns credit_balance, in US cents. Use this to check the account can pay for a generation before starting one.
Inputs
This tool takes no inputs.
lumalabs_get_generationGet one Luma AI generation (video, image, upscale, audio, modify or reframe job) by its ID.Read-onlyGet Generation
Get one Luma AI generation (video, image, upscale, audio, modify or reframe job) by its ID. Returns id, generation_type, state (queued, dreaming, completed or failed), failure_reason, created_at, model, the original request, and assets with the video, image or progress_video URL. Use this to poll a job you just started until it is completed or failed. Use lumalabs_list_generations to browse past generations.
Inputs
generation_idstringrequired- ID (UUID) of a Luma AI generation, as returned by a create tool or lumalabs_list_generations. Example: 123e4567-e89b-12d3-a456-426614174000
lumalabs_list_camera_motionsList the camera motion phrases Luma AI recognizes in video prompts, such as "camera orbit left".Read-onlyList Camera Motions
List the camera motion phrases Luma AI recognizes in video prompts, such as "camera orbit left". Returns an array of camera motion strings (wrapped as array in the tool result). Use this to find wording for camera moves inside a prompt. Use lumalabs_list_concepts for structured concept keys, which Luma now recommends.
Inputs
This tool takes no inputs.
lumalabs_list_conceptsList the camera concept keys Luma AI Ray accepts, such as dolly_zoom, orbit_left, push_in and aerial_drone.Read-onlyList Concepts
List the camera concept keys Luma AI Ray accepts, such as dolly_zoom, orbit_left, push_in and aerial_drone. Returns an array of concept key strings (wrapped as array in the tool result). Use this to pick values for the concepts input of lumalabs_create_video or lumalabs_extend_video. Use lumalabs_list_camera_motions for camera phrases to write into a prompt instead.
Inputs
This tool takes no inputs.
lumalabs_list_generationsList the Luma AI generations made with this API key, newest first, one page at a time.Read-onlyList Generations
List the Luma AI generations made with this API key, newest first, one page at a time. Returns generations (each with id, state, assets, model and request), plus count, limit, offset and has_more. Use this to browse or find past generations. Use lumalabs_get_generation when you already have an ID.
Inputs
limitinteger- Maximum number of generations to return in this page. Server default is 100. Example: 20
offsetinteger- Number of generations to skip, for paging. Use the previous offset plus limit while has_more is true. Server default is 0. Example: 20
lumalabs_add_audioGenerate a soundtrack and sound effects for a completed Luma AI video generation from a text prompt.WriteAdd Audio
Generate a soundtrack and sound effects for a completed Luma AI video generation from a text prompt. Returns a generation object for the audio job; the video with audio appears in its assets.video once state is completed. Use this to add sound to a video made with Luma AI. The source must be a completed video generation. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
generation_idstringrequired- ID (UUID) of a Luma AI generation, as returned by a create tool or lumalabs_list_generations. It must be a completed video generation. Example: 123e4567-e89b-12d3-a456-426614174000
promptstringrequired- Text describing the audio to generate. Example: Crunching snow footsteps and a distant wind howl
negative_promptstring- Sounds to avoid in the generated audio. Example: music, speech
lumalabs_create_imageGenerate an image with Luma AI's Photon models from a text prompt, optionally guided by reference images, a style image, a character's photos, or an image to edit.WriteCreate Image
Generate an image with Luma AI's Photon models from a text prompt, optionally guided by reference images, a style image, a character's photos, or an image to edit. Returns the generation object with its id and state; the image URL appears in assets.image once state is completed (set sync to true to wait for it in the same call). Use this for still images and image edits. Use lumalabs_reframe_image to change an existing image's aspect ratio, and lumalabs_create_video for video.
Inputs
promptstringrequired- Text describing the image to generate, or the change to make when modify_image_url is set. Example: A teddy bear in sunglasses playing electric guitar
aspect_ratiostring- Aspect ratio of the output: one of 1:1, 16:9, 9:16, 4:3, 3:4, 21:9 or 9:21. Example: 9:16 Leave empty for the server default (16:9).one of
1:116:99:164:33:421:99:21 character_ref_imagesarray- Up to 4 public photo URLs of the same person, used to keep that character consistent in the image. More photos give a better likeness. Example: ["https://example.com/person-1.jpg"]
formatstring- Output file format: jpg or png. Leave empty for jpg. Example: pngone of
jpgpng image_refarray- Up to 4 reference images that guide the content of the generation, each with a public url and an optional weight from 0 to 1 that sets its influence. Useful for variations of an image or hard-to-describe concepts. Example: [{"url": "https://example.com/ref.jpg", "weight": 0.85}]
modelstring- Photon image model: photon-1 (higher quality) or photon-flash-1 (faster and cheaper). Defaults to photon-1. Example: photon-flash-1one of
photon-1photon-flash-1defaultphoton-1 modify_image_urlstring- Public URL of an existing image to edit according to the prompt (image-to-image). Example: https://example.com/garden.jpg
modify_image_weightnumber- How closely the result follows modify_image_url, from 0 to 1: higher stays closer to the input, lower is more creative. For color changes Luma recommends 0.0 to 0.1. Only used with modify_image_url. Example: 0.8
style_refarray- Style reference images whose look is applied to the generation, each with a public url and an optional weight from 0 to 1. Example: [{"url": "https://example.com/style.jpg", "weight": 0.8}]
syncboolean- Set to true to wait for the image to finish and return the completed generation in this call, instead of polling lumalabs_get_generation. Example: true
sync_timeoutnumber- Seconds to wait when sync is true (server default 60; capped at 100 by this tool). If the image is not done in time, poll lumalabs_get_generation. Example: 60
lumalabs_create_videoStart a Luma AI Ray video generation from a text prompt, optionally guided by a start and/or end image and camera concepts.WriteCreate Video
Start a Luma AI Ray video generation from a text prompt, optionally guided by a start and/or end image and camera concepts. Returns the new generation object with its id and state (queued); the video URL appears in assets.video once state is completed. Use this for text-to-video and image-to-video. Use lumalabs_extend_video to continue or bridge an existing generated video, and lumalabs_create_image for still images. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
promptstringrequired- Text describing the video: subject, action, setting and style (3 to 5000 characters). Camera moves can also be written in the prompt, for example 'camera orbit left'. Example: A tiger walking through fresh snow at dawn, cinematic
aspect_ratiostring- Aspect ratio of the output: one of 1:1, 16:9, 9:16, 4:3, 3:4, 21:9 or 9:21. Example: 9:16 Leave empty for the server default (16:9).one of
1:116:99:164:33:421:99:21 conceptsarray- Camera concept keys that steer camera movement and framing, combined in one shot. Get valid keys from lumalabs_list_concepts; common ones are dolly_zoom, orbit_left, push_in, aerial_drone and handheld. Example: ["dolly_zoom", "handheld"]
durationstring- Video length: 5s or 9s. Leave empty for the default (5s). Example: 5sone of
5s9s end_image_urlstring- Public URL of an image to use as the last frame; the video animates toward it. Can be combined with start_image_url to animate between two images. Example: https://example.com/end-frame.jpg
loopboolean- Set to true to make the video loop seamlessly (last frame flows into the first). Not supported when both a start and an end image are given. Example: true
modelstring- Ray video model to use: ray-2 (higher quality) or ray-flash-2 (faster and cheaper). Defaults to ray-2. Example: ray-flash-2one of
ray-2ray-flash-2defaultray-2 resolutionstring- Output resolution: 540p, 720p, 1080p or 4k. Higher resolutions cost more. Leave empty for the model default. Example: 720pone of
540p720p1080p4k start_image_urlstring- Public URL of an image to use as the first frame (image-to-video). Must be reachable by Luma's servers; upload it to your own storage or CDN first. Example: https://example.com/start-frame.jpg
lumalabs_extend_videoStart a Luma AI Ray video generation that continues an existing generated video forward, leads up to it backward, or bridges it to an image or another generated video.WriteExtend Video
Start a Luma AI Ray video generation that continues an existing generated video forward, leads up to it backward, or bridges it to an image or another generated video. Returns the new generation object with its id and state (queued); the extended clip appears in assets.video once state is completed. Use this only for videos made with Luma AI. Use lumalabs_create_video for a new video from text or images. The source generation must be in state completed; check it with lumalabs_get_generation.
Inputs
generation_idstringrequired- ID (UUID) of a Luma AI generation, as returned by a create tool or lumalabs_list_generations. It must be a completed video generation. Example: 123e4567-e89b-12d3-a456-426614174000
promptstringrequired- Text describing what happens in the new footage: subject, action, setting and style (3 to 5000 characters). Camera moves can also be written in the prompt, for example 'camera orbit left'. Example: A tiger walking through fresh snow at dawn, cinematic
aspect_ratiostring- Aspect ratio of the output: one of 1:1, 16:9, 9:16, 4:3, 3:4, 21:9 or 9:21. Match the source video's aspect ratio. Example: 9:16 Leave empty for the server default (16:9).one of
1:116:99:164:33:421:99:21 conceptsarray- Camera concept keys that steer camera movement and framing, combined in one shot. Get valid keys from lumalabs_list_concepts; common ones are dolly_zoom, orbit_left, push_in, aerial_drone and handheld. Example: ["dolly_zoom", "handheld"]
directionstring- forward continues the source video after its last frame; backward generates footage that leads up to its first frame. Defaults to forward. Example: backwardone of
forwardbackwarddefaultforward durationstring- Video length: 5s or 9s. Leave empty for the default (5s). Example: 5sone of
5s9s loopboolean- Set to true to make the result loop. Only supported when extending forward with no other end set. Example: false
modelstring- Ray video model to use: ray-2 (higher quality) or ray-flash-2 (faster and cheaper). Defaults to ray-2. Example: ray-flash-2one of
ray-2ray-flash-2defaultray-2 other_end_generation_idstring- Optional ID of a second completed Luma AI video generation to interpolate to, producing a clip that bridges the two videos. Do not combine with other_end_image_url. Example: 9b2f6c1e-4d3a-4f8b-a1c2-7e5d3b9a0f14
other_end_image_urlstring- Optional public image URL for the opposite end of the new clip: the final frame when extending forward, the opening frame when extending backward. Do not combine with other_end_generation_id. Example: https://example.com/final-frame.jpg
resolutionstring- Output resolution: 540p, 720p, 1080p or 4k. Higher resolutions cost more. Leave empty for the model default. Example: 720pone of
540p720p1080p4k
lumalabs_modify_videoRestyle or edit any video with Luma AI Ray while keeping its motion, guided by a prompt and an optional styled first frame.WriteModify Video
Restyle or edit any video with Luma AI Ray while keeping its motion, guided by a prompt and an optional styled first frame. Returns the new generation object with its id and state (queued); the modified video appears in assets.video once state is completed. Use this to retexture, restyle or swap elements of an existing video file. Use lumalabs_reframe_video to change aspect ratio, and lumalabs_extend_video to add footage. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
media_urlstringrequired- Public URL of the source video to modify (up to 100 MB; up to 10s for ray-2 or 15s for ray-flash-2). Example: https://example.com/source.mp4
modestringrequired- How closely the output follows the source. adhere_1 to adhere_3 stay very close (light retexture or filter); flex_1 to flex_3 keep recognizable shapes and characters with bigger style changes; reimagine_1 to reimagine_3 loosely follow the source for a whole new world or style. Higher numbers within a family move further from the source. Example: flex_1one of
adhere_1adhere_2adhere_3flex_1flex_2flex_3reimagine_1reimagine_2reimagine_3 modelstringrequired- Ray video model used to modify the video: ray-2 (higher quality) or ray-flash-2 (faster and cheaper; accepts longer source videos). Example: ray-2one of
ray-2ray-flash-2 first_frame_urlstring- Optional but recommended: public URL of an image showing the desired first frame of the modified video, which guides the result. Example: https://example.com/styled-first-frame.png
promptstring- Text directing how to change the video. Example: Turn the scene into a hand-drawn anime style at night
lumalabs_reframe_imageChange an image's aspect ratio with Luma AI Photon by generating new content around it (outpainting).WriteReframe Image
Change an image's aspect ratio with Luma AI Photon by generating new content around it (outpainting). Returns the new generation object with its id and state (queued); the reframed image appears in assets.image once state is completed. Use this to adapt an existing image to another aspect ratio. Use lumalabs_create_image to generate or edit an image, and lumalabs_reframe_video for video. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
aspect_ratiostringrequired- Aspect ratio of the output: one of 1:1, 16:9, 9:16, 4:3, 3:4, 21:9 or 9:21. This is the target aspect ratio; Luma generates content for the new area. Example: 9:16one of
1:116:99:164:33:421:99:21 media_urlstringrequired- Public URL of the source image to reframe (up to 10 MB). Example: https://example.com/portrait.jpg
modelstringrequired- Photon image model used to reframe: photon-1 (higher quality) or photon-flash-1 (faster and cheaper). Example: photon-1one of
photon-1photon-flash-1 formatstring- Output file format: jpg or png. Leave empty for jpg. Example: pngone of
jpgpng grid_position_xinteger- Advanced, optional. Horizontal pixel offset at which to place the source inside the new canvas. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 120
grid_position_yinteger- Advanced, optional. Vertical pixel offset at which to place the source inside the new canvas. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
promptstring- Optional text steering what Luma generates in the newly added area. Example: Continue the city skyline to the left and right
resized_heightinteger- Advanced, optional. Height, in pixels, to resize the source to before placing it. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 720
resized_widthinteger- Advanced, optional. Width, in pixels, to resize the source to before placing it. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 1280
x_endinteger- Advanced, optional. Right edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 1280
x_startinteger- Advanced, optional. Left edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
y_endinteger- Advanced, optional. Bottom edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 720
y_startinteger- Advanced, optional. Top edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
lumalabs_reframe_videoChange a video's aspect ratio with Luma AI Ray by generating new content around it (for example landscape to vertical).WriteReframe Video
Change a video's aspect ratio with Luma AI Ray by generating new content around it (for example landscape to vertical). Returns the new generation object with its id and state (queued); the reframed video appears in assets.video once state is completed. Use this to adapt a video to another aspect ratio. Use lumalabs_reframe_image for still images and lumalabs_modify_video to restyle a video. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
aspect_ratiostringrequired- Aspect ratio of the output: one of 1:1, 16:9, 9:16, 4:3, 3:4, 21:9 or 9:21. This is the target aspect ratio; Luma generates content for the new area. Example: 9:16one of
1:116:99:164:33:421:99:21 media_urlstringrequired- Public URL of the source video to reframe (up to 100 MB; up to 10s for ray-2 or 30s for ray-flash-2). Example: https://example.com/landscape.mp4
modelstringrequired- Ray video model used to reframe the video: ray-2 (higher quality) or ray-flash-2 (faster and cheaper; accepts longer source videos). Example: ray-2one of
ray-2ray-flash-2 first_frame_urlstring- Optional public URL of an image showing the desired first frame of the reframed video. Example: https://example.com/reframed-first-frame.jpg
grid_position_xinteger- Advanced, optional. Horizontal pixel offset at which to place the source inside the new canvas. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 120
grid_position_yinteger- Advanced, optional. Vertical pixel offset at which to place the source inside the new canvas. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
promptstring- Optional text steering what Luma generates in the newly added area. Example: Extend the beach and sky on both sides
resized_heightinteger- Advanced, optional. Height, in pixels, to resize the source to before placing it. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 720
resized_widthinteger- Advanced, optional. Width, in pixels, to resize the source to before placing it. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 1280
x_endinteger- Advanced, optional. Right edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 1280
x_startinteger- Advanced, optional. Left edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
y_endinteger- Advanced, optional. Bottom edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 720
y_startinteger- Advanced, optional. Top edge, in pixels, of the crop bounds applied to the source. All positioning values are pixels on the target canvas for the chosen aspect ratio (for video, 16:9 is 1280x720; for images, 16:9 is 2048x1152). Leave empty to let Luma fit the source automatically. Example: 0
lumalabs_upscale_videoUpscale a completed Luma AI video generation to a higher resolution (720p, 1080p or 4k).WriteUpscale Video
Upscale a completed Luma AI video generation to a higher resolution (720p, 1080p or 4k). Returns a generation object for the upscale job; the upscaled video URL appears in its assets.video once state is completed. Use this to raise the resolution of a video already made with Luma AI. Use lumalabs_create_video with resolution set to generate at a higher resolution from the start. The source must be a completed video generation. Poll lumalabs_get_generation with the returned id until state is completed or failed.
Inputs
generation_idstringrequired- ID (UUID) of a Luma AI generation, as returned by a create tool or lumalabs_list_generations. It must be a completed video generation. Example: 123e4567-e89b-12d3-a456-426614174000
resolutionstringrequired- Target resolution, higher than the source: 720p (from 540p), 1080p (from 540p or 720p) or 4k (from 540p, 720p or 1080p). Example: 4kone of
720p1080p4k
lumalabs_delete_generationPermanently delete a Luma AI generation by its ID.DestructiveDelete Generation
Permanently delete a Luma AI generation by its ID. Returns an empty response on success. Use this to remove a generation you no longer need; it cannot be undone. Use lumalabs_get_generation to check a generation before deleting it.
- Idempotent
Inputs
generation_idstringrequired- ID (UUID) of a Luma AI generation, as returned by a create tool or lumalabs_list_generations. This generation will be permanently deleted. Example: 123e4567-e89b-12d3-a456-426614174000
No tools match.