---
title: "Generate a finished narrated short from a topic, via x402"
method: POST
path: "/api/x402/short"
---

# Generate a finished narrated short from a topic, via x402

`POST /api/x402/short`

## Request

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

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.

## Headers

- `Prefer` string

## Request body

- object
  - `topic` string, required: What the short is about.
  - `style` 'motion' | 'stills'
  - `voice` string: 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.
  - `async` boolean

## Response `200`

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.

- object
  - `runId` string
  - `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.
  - `video` string, uri: URL of the finished short (MP4, 9:16). Use it exactly as given.
  - `outputs` object
    - `video` string, uri
    - `title` string
    - `description` string: Two sentences and hashtags, ready to post.
  - `statusUrl` string, uri
  - `pollAfterMs` integer
  - `alreadyPaid` object: Only when this wallet already bought this exact request and its file never reached it: the earlier purchase this answer hands over (runId, boughtAt). The new payment was not taken and paidUsd is 0.
    - `runId` string
    - `boughtAt` string, date-time
  - `paidUsd` number
  - `style` string
  - `voice` string
  - `network` string
  - `transaction` string
  - `payer` string
  - `error` string
  - `reason` 'prompt_refused' | 'render_failed'
  - `retryable` boolean
  - `retryUrl` string, 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).
  - `message` string: Failed runs only. What happened, what the steps that ran were charged, and what to do.

## Other responses

- `400`: Missing or oversized topic, a style or voice not on the menu, or a field this endpoint does not read. Refused before settlement, so nothing was charged.
- `402`: Payment required: the challenge response carrying x402 payment instructions, priced for the style asked for.
- `409`: This payment was already redeemed (code PAYMENT_ALREADY_REDEEMED).
- `429`: Rate limit exceeded
- `503`: Shorts are temporarily unavailable. Nothing was charged.

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
