Cancel a job
POST/v1/jobs/{id}/cancel
Cancel a job that's still waiting in line. Its credits go back to the wallet. A job that has started runs to the end.
Needs the generate scope.
Path
| Field | Type | Description |
|---|---|---|
idrequired | string | The job id (job_…). |
Example
curl -X POST https://www.luce.space/api/v1/jobs/job_api7QmVZk2rT9wXs1bYc/cancel \
-H "Authorization: Bearer $LUCE_API_KEY"Response
HTTP 200.
{
"id": "job_api7QmVZk2rT9wXs1bYc",
"object": "job",
"type": "image.generate",
"status": "cancelled",
"livemode": true,
"created_at": "2026-11-24T10:15:02.114Z",
"completed_at": null,
"cost": {
"credits": 0,
"prepaid": 0,
"pay_as_you_go": 0
},
"output": null,
"error": {
"code": "cancelled",
"message": "The job was cancelled before it started."
},
"metadata": {
"order_id": "A-1042"
}
}Errors
| code | When |
|---|---|
not_found | No such job, file or webhook for this studio. |
not_cancellable | The job has started; only queued jobs can be cancelled. |