Render a failed pay-per-video run again, without paying twice

A render that failed after the payment settled (the model refused the prompt, or the render did not finish) charged nothing, so the payment is still on the wallet's balance. POST here with the failed run's claim ticket to render again on that balance. Send {"prompt": "..."} to reword the prompt, which is the fix for prompt_refused; send no body to render the original prompt again. The retry renders the same model, length, aspect ratio, and first frame the failed run was sold. Each failed run can be retried once. Like the paid POST, it waits by default about as long as that model usually takes to render (Prefer: wait=N, at most 720) and ends with the result, or with status running and a statusUrl, in the same streamed 200 response; send "async": true, or the header Prefer: respond-async, for an immediate answer (200, status running) with a new runId and statusUrl. A run whose render outlasted its deadline is refused (409) while its clip is being collected.

post/api/x402/video/retry

Request

  • Base URL: https://www.trezalabs.com
  • URL: https://www.trezalabs.com/api/x402/video/retry
  • Auth: HTTP bearer

Query parameters

runIdstring required

The failed run, from its status response.

tokenstring required

Signed claim ticket from the paid POST. The retryUrl in the status response carries both.

Headers

Preferstring

Optional. respond-async answers at once (200, status running); wait=N sets how long the call waits for the render, in seconds (at most 720). Without it, the call waits about as long as that model and length usually take to render, as the paid POST does, which can be several minutes.

Request body

promptstring

A reworded prompt. Omit to render the original again.

asyncboolean

true answers at once (200, status running) with a statusUrl to poll, instead of waiting for the render.

Response

The retry started and the response waited for it, by default about as long as that model usually takes to render, streamed the same way as the paid POST (X-Status-Url header at once, a whitespace byte every 2 seconds, then the JSON). Same shape as the paid POST's 200, plus retryOf (the failed run) and paidUsd 0. Read status in the body: success carries video; running means the render is still going, so poll statusUrl.

runIdstring
status'success' | 'error' | 'partial' | 'cancelled' | 'running'
videostring uri

URL of the finished video. Use it exactly as given.

outputsobject
statusUrlstring uri
retryOfstring
paidUsdnumber
modelstring

The model the failed run was sold on; the retry renders on the same one.

secondsnumber
aspectRatiostring
errorstring

If the retry failed too: what went wrong, in the provider's words.

reason'prompt_refused' | 'render_failed'
messagestring
balanceUsdnumber

Example response

{
  "status": "success"
}

Changes

No recorded changes to this operation across all 1 revision of this API.