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.

post/v1/tasks/{id}/cancel

Request

  • Base URL: https://gateway.amux.ai
  • URL: https://gateway.amux.ai/v1/tasks/{id}/cancel
  • Auth: HTTP bearer

Path parameters

idstring required

The task ID returned at submission.

Response

The task state after cancelling (or its existing terminal state).

idstring

The task ID. Use it to retrieve the result and to find the call in your logs.

status'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'expired'

The last four are terminal and will not change again.

expired means the task did not complete and its result can no longer be retrieved. Those are not charged and the reserve has been released.

modelstring

The model this task ran on.

created_atstring date-time

When the task was submitted.

coststring

What was actually charged, in USD. Failed and expired are 0.

notesstring[]

What we did to your request. Present only when something was done — no key means it went upstream unchanged.

Two kinds: parameters this upstream does not have were dropped, and a value was filled in for you. There is one case of the latter today: MiniMax text-only generation requires a concrete ratio (adaptive has no material to follow), so 16:9 is sent and noted here.

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.