Skip to main content
POST
Cancel request
Stop a live request. The run is marked cancelled and the generation backend is asked to stop; the response is the request’s state afterwards. Gems are not returned on cancellation, as in the web app. Cancelling a request that already finished is a 409 request_finished. Cancelling one that is already cancelled does nothing and returns its state.

Authorizations

Authorization
string
header
required

An API key from Settings → API, sent as Authorization: Bearer mage_sk_…. Keys are for server-side code only.

Path Parameters

request_id
string<uuid>
required

The request_id from the submit response.

Response

The request's state after the cancellation.

request_id
string<uuid>
required

The request id, also the id in status_url and cancel_url.

status
enum<string>
required

queued and in_progress are live; completed, failed, and cancelled are final.

Available options:
queued,
in_progress,
completed,
failed,
cancelled
architecture
string
required

The architecture the request generates with.

model_id
string | null
required

The model variant, when the architecture has variants.

created_at
string<date-time>
required

When the request was accepted.

updated_at
string<date-time>
required

When the request last changed.

billing
object
required
result
object | null
required

The output once status is completed, else null.

error
object | null
required

Why the request failed once status is failed, else null.

status_url
string<uri>
required

Poll this URL for the request.

cancel_url
string<uri>
required

POST to this URL to stop the request.

Last modified on September 17, 2026