Agent API (x402)Explainer video

Explainer video through AiSpace

Venice generates the pieces. This gateway has no stitch/concat route — assemble the MP4 on the user’s machine (ffmpeg or similar). Every paid call is x402 on https://x402.aispace.bot.

PiecePathPay?
Script / scene planPOST /api/v1/chat/completionsPaid sync
Optional scene stillsPOST /api/v1/image/generatePaid sync
Price each clipPOST /api/v1/video/quoteFree
Queue each clipPOST /api/v1/video/queuePaid
Poll / download clipPOST /api/v1/video/retrieveFree (binary mp4 or download_url)
Cleanup clipPOST /api/v1/video/completeFree
NarrationPOST /api/v1/audio/speechPaid sync
Price music bedPOST /api/v1/audio/quoteFree
Queue musicPOST /api/v1/audio/queuePaid
Poll / download musicPOST /api/v1/audio/retrieveFree

Follow Create a video and Create audio for field rules. Do not re-queue a job that is still PROCESSING.

1. Script, then fit durations

Draft narration with /chat/completions (model + messages; optional max_tokens, reasoning_effort). Split into scenes. Video models only accept duration strings from model_spec.constraints.durations on GET /api/v1/models?type=video — merge or split scenes rather than inventing a length.

Use the same video model and aspect ratio for every scene so a local concat does not stretch frames.

2. Quote the whole project (free), then confirm

Sum:

  • /video/quote per scene (model + duration, plus resolution/aspect when they change price). { quote } is the agent charge.
  • /audio/quote for the music bed (model + duration_seconds; no prompt).
  • One /audio/speech 402 (or ?priceOnly=1) for the full script — TTS is billed per request, often on the min floor.

Show the total. This is the expensive workflow. A quote 200 does not validate the queue body.

3. Generate pieces

  1. Narration first (sync, paid): /audio/speech with model, input, voice from ?type=tts. Check duration locally before paying for video.
  2. One clip first: /video/queue then /video/retrieve. Confirm the look before queuing the rest.
  3. Remaining clips: queue each (each 402 is a new charge), poll independently ~10–15s. Save queue_id + model. If retrieve is JSON with download_url, GET that URL (~24h).
  4. Music: /audio/queue with model + prompt (instrumental description), then retrieve. 60s-floor ids such as ace-step-15 need ?floor=all on the music catalog.

Optional consistency: generate a still per scene (/image/generate, same style line) and animate with an I2V model + image_url.

4. Assemble locally

This marketplace does not mux audio or concat clips. After you have scene MP4s, narration files, and a music bed, join them with local tools. Drop model-generated clip audio if you are using TTS (-an in ffmpeg).

Cleanup

/video/complete and /audio/complete are free and best-effort. After a successful binary retrieve the gateway may return { success: true, alreadyCompleted: true }. download_url results have nothing to complete.

Cost

Each scene queue is a full video charge. Retakes are billed again. Quote first; regenerate only the scenes that failed.