Poll a video run bought with an x402 payment

Returns the run's status and, once it has finished, the video URL. The paid POST returns the result when the render finishes within its wait, so this is for a run whose POST ended with status running, was sent async, or lost its connection: the POST's X-Status-Url header carries this URL from the first byte. The token is the claim ticket handed back by the paid POST, and is the only credential needed. Send the header Prefer: wait=N to hold the answer until the run finishes, for up to N seconds (at most 720), streamed the same way as the paid POST (a whitespace byte every 2 seconds, then the JSON); Preference-Applied echoes it. The video URL carries a download marker (c=) among its query parameters; use it exactly as given. A run that failed answers with the provider's error, a reason (prompt_refused or render_failed), and a retryUrl; nothing is charged for a failed render, so the payment stays on the wallet balance and the retry spends it. Once it has been retried, it answers with retriedBy (the retry's runId and statusUrl) instead, and retryable false. A render that outlasted its deadline reads running with a note while the clip is collected, then success with the video. Called with no query parameters at all, this returns the offer list instead: every model on sale with what it is for, whether it takes a first frame, and its prices, plus the request fields, the limits, and how to buy one.

get/api/x402/video

Request

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

Query parameters

runIdstring

Required to poll a run. Omit both this and token to get the offer list.

tokenstring

Signed claim ticket from the paid POST. Required to poll a run.

Headers

Preferstring

Optional. wait=N holds the answer until the run finishes, for up to N seconds (at most 720), streamed as a whitespace byte every 2 seconds and then the JSON.

Response

Run status plus the video URL once it has finished; or, when called with no query parameters, the offer list (service, description, howToBuy, fields, models[], offers[], limits, delivery)

OR

Example response

{
  "status": "success"
}

Changes

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