Luma Dream Machine API: Ray2 Pricing and First Request

PiAPI provides Luma Dream Machine Ray2 through its video task API. You can start from a text prompt or guide a clip with an image. This guide uses PiAPI's current Dream Machine task contract and distinguishes API usage prices from subscription plan benefits.
Luma Dream Machine API Pricing on PiAPI
PiAPI's published Dream Machine rate is $0.20 for a 5-second video and $0.40 for a 9-second video. Those are per-task usage prices, not monthly subscription fees. Check the model page and pricing page before budgeting a production batch.
What the Current Luma API Supports
Ray2 generation workflows
- Text to video: Supply a prompt without a start image to describe the scene and motion.
- Image to video: Supply a public
start_imageURL with the prompt to animate a still. - End-frame guidance: The documented request also accepts
end_imagewhen the destination frame matters. - Duration and shape: Choose the documented 5- or 9-second duration and an appropriate
aspect_ratiofor the target placement. - Asynchronous result: Create a task, save its
task_id, and poll the task endpoint until it completes or fails.
Check the request contract before shipping
- Use top-level
model: "luma"andtask_type: "video_generation". - Use
input.model: "ray-v2"for the currently documented Ray2 model. - Use
start_imageandend_imagefor image references;image_urlis not the documented field here. - Handle pending, completed, and failed task states in your integration instead of assuming a video URL in the create response.
The current PiAPI docs say Ray1 is no longer supported and Ray3 is still in development. Do not label a Ray2 task as a Ray3 generation or promise Ray3 behavior on this endpoint.
How to Make a Dream Machine API Request
Create a task with POST https://api.piapi.ai/api/v1/task and your server-side X-API-Key. The PiAPI request documentation shows the full schema and response.
curl -X POST https://api.piapi.ai/api/v1/task \
-H "X-API-Key: $PIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"luma","task_type":"video_generation","input":{"model":"ray-v2","prompt":"A paper boat drifts across a calm pond","duration":5}}'- Text to video: Set
modeltoluma,task_typetovideo_generation, andinputto a prompt,model: "ray-v2", andduration: 5. Addaspect_ratiowhen your output format requires it. - Image to video: Use the same task shape and add a publicly reachable
input.start_imageURL. Addinput.end_imageonly when you have a deliberate target frame.
- Save the returned
task_id; task creation normally returns a pending task, not the final media. - Poll
GET https://api.piapi.ai/api/v1/task/{task_id}with your API key until the status is completed or failed. - Read the completed task's output video URL and handle errors, timeouts, and retries in your application.
Where Dream Machine Fits
- Short concept clips: Explore motion and camera ideas from a concise text brief.
- Still-image animation: Turn a prepared product or scene image into a short moving shot.
- Storyboard tests: Use a start image and optional end image to test a transition before producing a final campaign asset.
- Developer prototypes: Verify your task creation, polling, and output handling with a 5-second request before scaling.
These are workflow examples, not claims that every prompt will produce the same result. Keep source images accessible to PiAPI and review each output before use.
Luma Dream Machine API FAQ
How much does Luma Dream Machine cost through PiAPI?
The current published usage price is $0.20 per 5-second task or $0.40 per 9-second task. API usage is charged against your PiAPI credit balance; subscription fees and bonus credits are separate.
Does PiAPI's Free plan include monthly Luma credits?
The Free subscription plan itself lists no recurring free credits. PiAPI's current pricing page says new accounts start with $0.50 in free credits; confirm your balance and model access in the workspace before submitting a task.
How do I try the Ray2 API?
Sign in to PiAPI's Luma workspace, check your available credits, then follow the task documentation to create and poll a 5-second Ray2 request.
Start With a 5-Second Ray2 Task
Read the Luma Dream Machine API docs, compare the model's current pricing, and test a prompt in the PiAPI workspace. The API response gives you a task ID first; retrieve the finished video after the task completes.



