Cancel a Task
POST /v1/tasks/{id}/cancel
Only queued tasks can be canceled. Tasks already running cannot be stopped through this endpoint.
bash
curl -X POST https://api.llmapi.site/v1/tasks/8b17fd33b0e947a08cb417e81e9ea9da/cancel \
-H 'Authorization: Bearer YOUR_TASK_API_KEY'Response — 200 OK
Returns the updated task object with status: "canceled". The held estimated amount is released.
json
{
"id": "8b17fd33b0e947a08cb417e81e9ea9da",
"status": "canceled",
"modality": "image",
"model": "gpt-image-2",
"created_at": "2026-06-22T03:10:00Z"
}Errors
| Status | Cause |
|---|---|
401 | Missing or invalid API key. |
403 | API key is not enabled for Task API. |
404 | Task not found, or belongs to a different API key. |
409 | Task is not in queued status and cannot be canceled. |
503 | Task API is disabled or temporarily unavailable. |