Runs
Markdown ↗

Cancel a run

POST/api/v3/run/{id}/cancel

Overview

No request body. Cancels only queued runs that have never been admitted or dispatched. Admission and cancellation are serialized atomically. Running/outcome-unknown work returns 409 run_not_cancelable. Already terminal runs return their current snapshot with 200, including outputs if applicable. Repeating cancellation needs no Idempotency-Key. A newly canceled run releases its commitment and emits its configured terminal webhook once (delivery retries remain possible). Foreign or non-v3 runs return 404.

Requires an API key. Send Authorization: Bearer YOUR_API_KEY. Authentication →

curl 'https://fusara.ai/api/v3/run/123456/cancel' \
  --request POST \
  -H "Authorization: Bearer $FUSARA_API_KEY"

Parameters

idintegerrequired
  • path
  • Format: int64
  • Minimum: 1
  • Maximum: 4294967295

Responses

OK

Illustrative response. Prices, IDs and URLs come from your own request.

Example response
{
  "id": 123456,
  "status": "canceled",
  "cost": {
    "unit": "common_fuz",
    "expected": "40.0000",
    "status": "settled",
    "charged": "0.0000"
  }
}
idintegerrequired

Numeric run ID. Use it for status, results, cancellation and matching webhooks.

  • Format: int64
  • Minimum: 0
  • Maximum: 4294967295
statusstringrequired

queued or running while in progress; succeeded, failed or canceled when terminal.

costobjectrequired
Nested fields 4
unitstringrequired

Billing unit: common_fuz.

expectedstringrequired

Total accepted estimate for this run, as a decimal string.

statusstringrequired

pending until billing is confirmed, then settled. Generation can finish before settlement.

chargedstring

Confirmed final charge, as a decimal string. Omitted while pending; confirmed zero is 0.0000.

outputsobject[]

Applicable outputs in their original order. Omitted when none exist; a failed run can still have usable partial outputs.

Nested fields 7
typestringrequired
  • Alternative values: "text", "json", "boolean", "image", "video", "audio", "media", "model_asset"
media_idinteger

Reusable account media ID when this output is a file.

  • Format: int64
  • Minimum: 0
  • Maximum: 4294967295
urlstring

Download URL when the file is available. Save it before url_expires_at.

UTC expiry of this output URL, when provided.

  • Format: date-time
expiredboolean

True when the media is no longer available; its dead URL is omitted.

valueany JSON value

Inline result: a string for type=text, a native JSON value for type=json, or a boolean for type=boolean. Empty strings, false and JSON null are valid values. Omitted for files and model assets.

  • When type is "text": required; string
  • When type is "json": required; any JSON value
  • When type is "boolean": required; boolean
  • When type is "image" or "video" or "audio" or "media" or "model_asset": must be omitted
  • Format: int64
  • Minimum: 0
  • Maximum: 4294967295
errorobject
Nested fields 2
codestringrequired

Machine-readable generation failure code.

messagestringrequired

Human-readable explanation of the generation failure.

Response headers

X-Request-Idstringrequired

Support/trace identifier for this HTTP request.