Poll a track bought with an x402 payment, or read the menu

Called with no query parameters, returns the menu: what is on sale, every option and price, and how to buy. With runId and token (the statusUrl the paid POST handed back), returns the run's status and, once finished, audio: the file URL. The token is the claim ticket and the only credential needed. Send Prefer: wait=N to hold the answer until it finishes, for up to N seconds (at most 720), streamed like the paid POST. A failed run answers with the provider's error, a reason, and a retryUrl.

get/api/x402/music

Request

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

Query parameters

runIdstring

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

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).

Response

Run status plus audio once it has finished; or, with no query parameters, the menu.

OR

Example response

{
  "status": "success"
}

Changes

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