Inputs and files
Pass images and videos as uploads, earlier jobs, or public URLs.
Wherever a request takes an image or a video, you can pass any of these:
| Form | Example | Notes |
|---|---|---|
file_… | file_O57EAQfNx6UbXJxr | Uploaded with POST /v1/files. Kept 30 days. |
job_… | job_api7QmVZk2rT9wXs1bYc | The output of one of your earlier jobs. |
https://… | https://cdn.example.com/viewport.png | A public URL. We download it once; private, local and redirect-to-private addresses are refused. |
Upload a small file (up to 4 MB)
curl https://www.luce.space/api/v1/files \
-H "Authorization: Bearer $LUCE_API_KEY" \
-F file=@viewport.pngUpload a large file
Anything over 4 MB (most videos) goes in three steps, and the bytes go straight to storage: ask for an upload, PUT the file to the signed URL you get back (within 15 minutes, with the Content-Type header shown), then complete it.
# 1. Start the upload
curl -X POST https://www.luce.space/api/v1/files/uploads \
-H "Authorization: Bearer $LUCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content_type": "video/mp4", "bytes": '"$(wc -c < walkthrough.mp4)"', "name": "walkthrough.mp4"}'
# → { "id": "file_Jl2EkOMeVu6EXhts", "status": "uploading", "upload": { "url": "https://…", "method": "PUT", … } }
# 2. Send the bytes to upload.url
curl -X PUT "$UPLOAD_URL" -H "Content-Type: video/mp4" --data-binary @walkthrough.mp4
# 3. Complete it — the file is ready to use
curl -X POST https://www.luce.space/api/v1/files/file_Jl2EkOMeVu6EXhts/complete \
-H "Authorization: Bearer $LUCE_API_KEY"Limits
- Images: PNG, JPEG or WebP. Videos: MP4, MOV or WebM.
- POST /v1/files takes files up to 4 MB; larger ones use the three steps above (or a public URL).
- The file type is read from the file itself, not its name.
- Upscale accepts images up to 5,000 px on the longest edge (8,000 px on some plans).
- Output URLs are permanent links on Luce's media host. Download what you want to keep.