Upload a file

POST/v1/files

Upload an image or a video up to 4 MB to use as a job input. Send multipart/form-data with one file field.

Images: PNG, JPEG or WebP. Videos: MP4, MOV or WebM. Files are kept 30 days.

Bigger files (most videos) go through POST /v1/files/uploads: you get a signed URL to send the bytes to directly.

Needs the files scope.

Form fields

FieldTypeDescription
filerequiredfileThe image or video.

Example

curl https://www.luce.space/api/v1/files \
  -H "Authorization: Bearer $LUCE_API_KEY" \
  -F file=@viewport.png

Response

HTTP 201.

{
  "id": "file_O57EAQfNx6UbXJxr",
  "object": "file",
  "kind": "image",
  "content_type": "image/png",
  "bytes": 2483912,
  "width": 1920,
  "height": 1080,
  "name": "viewport.png",
  "url": "https://media.luce.space/teams/…/api-files/file_O57EAQfNx6UbXJxr.png",
  "created_at": "2026-11-24T10:14:55.010Z",
  "expires_at": "2026-12-24T10:14:55.010Z"
}

Errors

codeWhen
invalid_bodyThe body isn't valid JSON or misses a required field.
invalid_inputAn input image or video can't be used (unreachable, too large, wrong type, or an upload not completed).
file_too_largeThe direct upload is over 4 MB: use POST /v1/files/uploads instead.
Upload a file — Luce API reference