Generate a finished narrated short from a topic, via x402

Send a topic; get a finished 30-second vertical short: a written script, four scenes, an ElevenLabs narrator, a music bed, word-by-word captions and callout cards, plus a title and description to post it with. style motion ($3.22) animates each scene with Google Veo 3.1 Lite; stills ($0.87) edits the scenes' stills with a slow push-in. Pay via the x402 protocol (HTTP 402), in USDC on Base (eip155:8453) or Solana mainnet; no account, API key, or signup. A short takes three to five minutes: the paid call answers 200 at once with the statusUrl in X-Status-Url, waits about as long as that style usually takes (Prefer: wait=N for up to 720), then ends with status success and video, or status running and the statusUrl to poll. If a step fails part way (a scene the video model refuses), the steps that ran are charged, the rest of the payment stays on the wallet balance, and the free retry resumes the run, re-rendering only what failed. Lost the statusUrl? GET /api/x402/purchases and sign its challenge with the paying wallet (Sign-In-With-X, free) to list every purchase with its file and a fresh statusUrl. And the same request sent again from the same wallet, once the first render has finished and its file never reached you, is answered with that file (alreadyPaid, paidUsd 0) and the new payment is not taken.

post/api/x402/short

Request

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

Headers

Preferstring

Optional. respond-async answers at once (200, status running) with a statusUrl; wait=N waits up to N seconds (at most 720) before ending with status running and the statusUrl. Without it, the call waits about as long as that style usually takes: about four and a half minutes for stills, five for motion. A client with a fixed timeout, such as the 60 seconds MCP tool calls allow, should send wait=N under it or respond-async.

Request body

topicstring required

What the short is about.

style'motion' | 'stills'
voicestring

The narrator: a voices[].id from GET /api/x402/short (the /api/x402/speech voices billed at the standard rate, over 30 in all). An unknown voice is refused with a 400 before any payment moves.

asyncboolean

Response

Payment settled and the response waited for the short, streamed (a whitespace byte every 2 seconds, then one JSON object). Read status in the body.

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

success carries video. error, partial, and cancelled carry the failure fields. running means the short is still rendering; poll statusUrl.

videostring uri

URL of the finished short (MP4, 9:16). Use it exactly as given.

statusUrlstring uri
pollAfterMsinteger
paidUsdnumber
stylestring
voicestring
networkstring
transactionstring
payerstring
errorstring
reason'prompt_refused' | 'render_failed'
retryableboolean
retryUrlstring uri

Failed runs only. POST with no body to finish the short: steps that succeeded are reused, only what failed re-renders. With {"topic": "..."} it starts over (at the full price, from the balance).

messagestring

Failed runs only. What happened, what the steps that ran were charged, and what to do.

Example response

{
  "status": "success"
}

Changes

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