Generate a video
POST/v1/videos/generate
Animate an image into a 4, 6 or 8 second clip, optionally ending on a second image.
Priced per second of video at the chosen resolution.
Needs the generate scope. Creates a job of type video.generate; send an Idempotency-Key to retry safely.
Body
| Field | Type | Description |
|---|---|---|
imagerequired | string | The first frame. An image: a file id from POST /v1/files (file_…), the id of an earlier job whose output to use (job_…), or a public https:// URL (PNG, JPEG or WebP). |
last_frame | string | An image the clip should end on. |
promptrequired | string | The motion and mood, e.g. “slow dolly in at dusk, lights coming on”. Up to 2000 characters. |
duration | integer | Seconds.One of 4, 6, 8.Default 4. |
resolution | string | Output resolution.One of "720p", "1080p".Default "720p". |
aspect_ratio | string | Landscape or portrait.One of "16:9", "9:16".Default "16:9". |
metadata | object | Up to 20 keys of your own (string → string, values up to 500 characters). Stored on the job and returned with it and in webhooks. |
Example
curl -X POST https://www.luce.space/api/v1/videos/generate \
-H "Authorization: Bearer $LUCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"image": "job_api7QmVZk2rT9wXs1bYc",
"prompt": "slow dolly in at dusk, interior lights coming on",
"duration": 6,
"resolution": "1080p"
}'Response
HTTP 202. The job starts queued or running; GET /v1/jobs/{id} or a webhook tells you when it ends.
{
"id": "job_api7QmVZk2rT9wXs1bYc",
"object": "job",
"type": "video.generate",
"status": "queued",
"livemode": true,
"created_at": "2026-11-24T10:15:02.114Z",
"completed_at": null,
"cost": {
"credits": 390,
"prepaid": 390,
"pay_as_you_go": 0
},
"output": null,
"error": null,
"metadata": {
"order_id": "A-1042"
}
}Errors
| code | When |
|---|---|
invalid_body | The body isn't valid JSON or misses a required field. |
invalid_param | A field has a wrong type or an out-of-range value; param names it. |
invalid_input | An input image or video can't be used (unreachable, too large, wrong type, or an upload not completed). |
mode_unavailable | This mode isn't offered on the API. |
insufficient_balance | Prepaid AI Credits can't cover the job and pay as you go is off. |
monthly_cap_reached | The job would pass this month's pay-as-you-go cap. |
payment_past_due | Pay as you go is paused after a failed payment. |
idempotency_conflict | The Idempotency-Key was used before with a different body. |
rate_limited | Too many requests; wait for Retry-After seconds. |