Dream Machine API
$0.20-$0.40/video
Developer-ready API access
Want to allow your users to create breathtaking videos from a simple text prompt or an image? Checkout out PiAPI's Dream Machine API - start generating high-quality videos today!
Pay-as-you-go access through PiAPI.
$0.20-$0.40/video
Developer-ready API access
Sign up and grab an API key from the PiAPI workspace — free credits are included on sign-up.
Add credits on the billing page when you are ready to scale beyond the free tier.
POST your first task following the API docs, then poll the task until the result is ready.
Prototype prompts and settings in the the playground above before wiring them into your product.
curl -X POST 'https://api.piapi.ai/api/v1/task' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "luma",
"task_type": "video_generation",
"input": {
"prompt": "A cinematic slow push through a misty mountain valley at sunrise.",
"duration": 5,
"aspect_ratio": "16:9"
}
}'
# → { "task_id": "9d5a…", "status": "pending" }curl 'https://api.piapi.ai/api/v1/task/{task_id}' \
-H 'X-API-Key: YOUR_API_KEY'
# poll until status = completed
{
"data": {
"status": "completed",
"output": {
"video_url": "https://img.theapi.app/ephemeral/…"
}
}
}$ npm install -g piapi-cli $ piapi run dream-machine-api \ prompt="A cinematic slow push through a misty mountain valley at sunrise." \ duration=5 \ aspect_ratio=16:9 ✓ Task completed! https://img.theapi.app/ephemeral/…