Cancel a task
Cancels a task that has not started yet and releases the credit reserved at submission.
Only queued tasks can be canceled. Once an executor picks the task up (running), the request is already with the upstream provider — the money may already be spent and the output will still come back. Cancelling then returns 400 rather than silently discarding a generation you have already paid for.
A task that already reached a terminal state returns 200 with its current status: cancelling expresses "stop running this", and a finished task is not running. This endpoint is safe to call repeatedly.
Request
- Base URL: https://gateway.amux.ai
- URL: https://gateway.amux.ai/v1/tasks/{id}/cancel
- Auth: HTTP bearer
Path parameters
The task ID returned at submission.
Response
The task state after cancelling (or its existing terminal state).
Example response
{
"id": "task_01M1CG35C16CJ790D00BV1RBVM",
"model": "openai/gpt-image-2",
"cost": "0.2108",
"notes": [
"dropped audio: this model decides the soundtrack itself"
]
}Changes
No recorded changes to this operation across all 1 revision of this API.