Luce API
Run Luce's renders, edits, upscales and videos from your own apps.
The Luce API gives your app the same tools your studio uses in Luce: turn a sketch or a 3D viewport into a render, edit part of an image in words, upscale it, change the camera angle, and make or edit videos. You send a request, get a job back, and collect the result when it finishes, by polling or through a webhook.
Quickstart
- In Luce, open Settings → API and create a key. Start with a test key: it checks your requests and returns sample results without charging anything.
- Upload an image (or use a public image URL).
- Start a render, then wait for the job.
1. Upload an image
curl https://www.luce.space/api/v1/files \
-H "Authorization: Bearer $LUCE_API_KEY" \
-F file=@viewport.png2. Start a render
curl -X POST https://www.luce.space/api/v1/images/generate \
-H "Authorization: Bearer $LUCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"mode": "comfy_render_2",
"image": "file_O57EAQfNx6UbXJxr",
"tags": [
"Golden Hour"
],
"size": "2K",
"metadata": {
"order_id": "A-1042"
}
}'The answer is a job with status queued or running. Renders usually take 10–60 seconds and videos a few minutes.
3. Wait for it
async function waitForJob(id) {
for (;;) {
const res = await fetch(`https://www.luce.space/api/v1/jobs/${id}`, {
headers: { Authorization: `Bearer ${process.env.LUCE_API_KEY}` },
});
const job = await res.json();
if (job.status === "succeeded") return job.output;
if (job.status === "failed" || job.status === "cancelled") throw new Error(job.error.message);
await new Promise((r) => setTimeout(r, 3000)); // renders take ~10–60 s, videos a few minutes
}
}Rather than polling, you can add a webhook and we'll call your server when the job ends.
What you can make
| Endpoint | What it does |
|---|---|
POST /v1/images/generate | Render an image in one of your modes — from a source image (a sketch, a 3D viewport, a photo) or from a prompt alone. |
POST /v1/images/edit | Change part of an image in words. With a mask, only the white area changes; without one, the whole image follows the prompt. |
POST /v1/images/upscale | Enlarge an image 2× or 4× with added detail. |
POST /v1/images/multi-angles | See the same scene from another angle: turn and tilt the camera (or the subject) and change the lens. |
POST /v1/videos/generate | Animate an image into a 4, 6 or 8 second clip, optionally ending on a second image. |
POST /v1/videos/edit | Change a video made by an earlier job, in words — “make it winter”, “turn the lights off”. |
POST /v1/videos/upscale | Upscale a video (precise or creative), slow it down 2× or 4×, or raise it to 60 fps. |
Base URL
https://www.luce.space/api/v1. Every request and response is JSON (uploads are multipart/form-data). Send your key in the Authorization header on every call.
The machine-readable description is at /api/v1/openapi.json (OpenAPI 3.1). Import it into Postman, Insomnia or a code generator.