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

FieldTypeDescription
imagerequiredstringThe 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_framestringAn image the clip should end on.
promptrequiredstringThe motion and mood, e.g. “slow dolly in at dusk, lights coming on”. Up to 2000 characters.
durationintegerSeconds.One of 4, 6, 8.Default 4.
resolutionstringOutput resolution.One of "720p", "1080p".Default "720p".
aspect_ratiostringLandscape or portrait.One of "16:9", "9:16".Default "16:9".
metadataobjectUp 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

codeWhen
invalid_bodyThe body isn't valid JSON or misses a required field.
invalid_paramA field has a wrong type or an out-of-range value; param names it.
invalid_inputAn input image or video can't be used (unreachable, too large, wrong type, or an upload not completed).
mode_unavailableThis mode isn't offered on the API.
insufficient_balancePrepaid AI Credits can't cover the job and pay as you go is off.
monthly_cap_reachedThe job would pass this month's pay-as-you-go cap.
payment_past_duePay as you go is paused after a failed payment.
idempotency_conflictThe Idempotency-Key was used before with a different body.
rate_limitedToo many requests; wait for Retry-After seconds.
Generate a video — Luce API reference