Skip to main content
Synthesize short clips with motion, lighting, and camera control derived from a textual storyboard. Videos render in H.264 MP4 format and include automatically generated preview GIFs.

Request body

  • prompt — Required creative direction or storyboard.
  • durationSeconds — Required integer between 1 and 20.
  • resolution — Optional preset (720p, 1080p, or square); defaults to 720p.
  • referenceFrames — Optional array of image URLs to guide composition.
  • soundtrack — Optional object describing background audio (e.g., { "preset": "ambient" }).
  • webhookUrl — Optional HTTPS URL Horizon should call when the video job finishes.

Sample request

curl https://api.worklet.cloud/v1/generate/videos \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Camera slowly orbits a floating botanical garden in low gravity.",
    "durationSeconds": 8,
    "resolution": "1080p",
    "referenceFrames": [
      "https://cdn.example.com/lookbook/botanical-1.png"
    ]
  }'

Response

Video jobs always run asynchronously. The API returns 202 Accepted with a jobId, statusUrl, and estimated completion etaSeconds. Once finished, the job record includes the MP4 download link, thumbnail URLs, and a storyboard track you can feed into editing tools.

Considerations

  • Keep durationSeconds under 10 for fastest results; longer clips may take several minutes.
  • Provide referenceFrames when you need continuity across a series of shots.
  • Use GET /jobs/{jobId} (identical to statusUrl) to poll status or fetch the final video bundle afterward.

x402 flow

Video rendering requires an x402 payment. Unfunded calls return 402 Payment Required with a PaymentRequiredResponse payload:
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base-sepolia",
      "maxAmountRequired": "500000",               // $0.50 in 6‑decimal USDC
      "resource": "POST /generate/videos",
      "description": "Horizon video generation",
      "mimeType": "application/json",
      "payTo": "0xYourReceivingWallet",
      "maxTimeoutSeconds": 300,
      "asset": "0xYourUSDCContract",
      "extra": {
        "name": "USDC",
        "version": "1"
      }
    }
  ],
  "error": null
}
Handle the challenge as prescribed in the Coinbase spec:
  1. Send the accepts entry to your facilitator (see Client & server responsibilities) and call /verify + /settle.
  2. Replay the request with the facilitator-issued Base64 payload in X-PAYMENT:
    curl https://api.worklet.cloud/v1/generate/videos \
      -H "Content-Type: application/json" \
      -H "X-PAYMENT: eyJ4NDAyVmVyc2lvbiI6MSwic2NoZW1lIjoiZXhhY3QiLC4uLn0=" \
      -d '{ ...original body... }'
    
  3. Horizon validates the header, resumes rendering, and, on success, includes settlement data under X-PAYMENT-RESPONSE.
First-time integrations should complete the Quickstart for sellers to stand up mainnet wallets and facilitator credentials.