typetext
{
"aspect_ratio": "16:9",
"duration": 5,
"exr_export": false,
"hdr": false,
"loop": false,
"prompt": "Vertical shot, close-up of raindrops sliding down a window pane at twilight, neon city lights blurred in the background, contemplative and atmospheric. \"Ray 3.2\" is written in the fog of the window",
"resolution": "720p"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AFO**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run luma/ray-3.2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "16:9",
duration: 5,
exr_export: false,
hdr: false,
loop: false,
prompt: "Vertical shot, close-up of raindrops sliding down a window pane at twilight, neon city lights blurred in the background, contemplative and atmospheric. \"Ray 3.2\" is written in the fog of the window",
resolution: "720p"
};
const output = await replicate.run("luma/ray-3.2", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AFO**********************************
This is your API token. Keep it to yourself.
import replicate
Run luma/ray-3.2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"luma/ray-3.2",
input={
"aspect_ratio": "16:9",
"duration": 5,
"exr_export": False,
"hdr": False,
"loop": False,
"prompt": "Vertical shot, close-up of raindrops sliding down a window pane at twilight, neon city lights blurred in the background, contemplative and atmospheric. \"Ray 3.2\" is written in the fog of the window",
"resolution": "720p"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_AFO**********************************
This is your API token. Keep it to yourself.
Run luma/ray-3.2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"aspect_ratio": "16:9",
"duration": 5,
"exr_export": false,
"hdr": false,
"loop": false,
"prompt": "Vertical shot, close-up of raindrops sliding down a window pane at twilight, neon city lights blurred in the background, contemplative and atmospheric. \\"Ray 3.2\\" is written in the fog of the window",
"resolution": "720p"
}
}' \
https://api.replicate.com/v1/models/luma/ray-3.2/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "99hv84byssrmy0cyp7qtt2q454",
"model": "luma/ray-3.2",
"version": "hidden",
"input": {
"aspect_ratio": "16:9",
"duration": 5,
"exr_export": false,
"hdr": false,
"loop": false,
"prompt": "Vertical shot, close-up of raindrops sliding down a window pane at twilight, neon city lights blurred in the background, contemplative and atmospheric. \"Ray 3.2\" is written in the fog of the window",
"resolution": "720p"
},
"logs": "Submitting Ray 3.2 video generation...\nVIDEO_GENERATION_ID: 52c1136c-9aa2-4de9-94c9-b0c5f987235b\nState: queued\nQueued. Checking again in 5.8 seconds...\nQueued. Checking again in 10.8 seconds...\nQueued. Checking again in 17.3 seconds...\nState: queued (still polling)\nQueued. Checking again in 30.0 seconds...\nState: completed\nGenerated video in 80.11s\nDownloading 2310416 bytes\nDownloaded 2.20MB in 0.08sec",
"output": "https://replicate.delivery/xezq/fdEWf8xneAONLpqhdxehQx9qcR6Av9OcanTmGhY61Q5uuJ3aB/tmpxvayx5qj.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2026-06-10T14:28:43.342Z",
"started_at": "2026-06-10T14:28:43.397466Z",
"completed_at": "2026-06-10T14:30:03.921683Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/99hv84byssrmy0cyp7qtt2q454/cancel",
"get": "https://api.replicate.com/v1/predictions/99hv84byssrmy0cyp7qtt2q454",
"stream": "https://stream.replicate.com/v1/files/jbxs-6funomz4ol36xesg6afhwolebp2tt7tykqhhgzvvzq6g76ca3yia",
"web": "https://replicate.com/p/99hv84byssrmy0cyp7qtt2q454"
},
"metrics": {
"model_variant": "sdr",
"predict_time": 80.524217602,
"resolution_target": "720p",
"total_time": 80.579683778,
"video_output_count": 1,
"video_output_duration_seconds": 5
}
}