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
| Field | Type | Description |
|---|---|---|
filerequired | file | The image or video. |
Example
curl https://www.luce.space/api/v1/files \
-H "Authorization: Bearer $LUCE_API_KEY" \
-F file=@viewport.pngResponse
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
| code | When |
|---|---|
invalid_body | The body isn't valid JSON or misses a required field. |
invalid_input | An input image or video can't be used (unreachable, too large, wrong type, or an upload not completed). |
file_too_large | The direct upload is over 4 MB: use POST /v1/files/uploads instead. |