Create a video through AiSpace
Video is asynchronous. On this gateway only queue settles USDC. quote, retrieve, and complete are free. Do not re-queue while retrieve returns PROCESSING — that starts another paid job.
Origin: https://x402.aispace.bot. Pay this marketplace (x402 or AISPACE_X402_KEY), not Venice.
POST /api/v1/video/quote → { quote } agent charge in USD (free)
POST /api/v1/video/queue → { model, queue_id } + optional download_url (paid — 402)
POST /api/v1/video/retrieve → PROCESSING json OR video/mp4 OR JSON with download_url (free)
POST /api/v1/video/complete → cleanup (free)1. Pick a model
GET /api/v1/models?type=video. Text-to-video and image-to-video are different ids (example T2V: wan-3-0-text-to-video; I2V: wan-3-0-image-to-video). Copy duration, aspect_ratio, and resolution from that row’s model_spec.constraints. A value not on the list is 400, not 503. Prompt max is model-specific (default 2500, up to 32000).
Mute models (audio: false) reject an audio field — omit it. Send audio only when audio_configurable is true. Seedance rows with needs_consent get consents attached on queue by this gateway.
2. Quote (free) and confirm
POST /api/v1/video/quote — pricing knobs: model + duration, plus resolution / aspect_ratio / hdr when they change the price. hdr: true is only valid when the model lists capabilities.supportsHdr and the resolution is in settings.hdrResolutions (Kling v4 at 1080p or 4k). Do not require prompt here (the gateway strips it if Venice quote 400s).
Response { quote, chargeUsd, upstreamUsd, priceMult, amountAtomic }. quote is already the agent charge (margin applied). upstreamUsd is the pre-margin Venice cost. Show the user quote and get a yes before queue.
A quote 200 is not proof the job will run. Queue needs a runnable body (prompt; I2V needs image_url).
3. Queue (paid)
POST /api/v1/video/queue — required on this gateway: model, prompt, duration. Optional: negative_prompt, resolution, aspect_ratio (omit when the I2V model lists none — the gateway strips it), hdr (same support rules as quote; other combinations are 400 before payment), image_url (I2V; image is remapped to image_url), consents.
Unpaid → 402. Settlement uses a fresh server-side Venice quote × margin, not the client quote amount. Save queue_id with model. Some VPS-backed models also return download_url on queue — keep it.
4. Poll retrieve (free)
POST /api/v1/video/retrieve — { model, queue_id }. Optional delete_media_on_completion: true (safe while still processing; Venice deletes only after it delivers).
| Result | What you get |
|---|---|
| Still working | JSON PROCESSING with average_execution_time / execution_duration (ms). Poll ~10–15s. |
| Still uploading | 409 — keep polling; not done. |
| Ready (non-VPS) | Binary video/mp4 — save immediately. |
| Ready (VPS) | JSON with a https download_url (or url). GET that URL (no auth). Link expires ~24h. |
Do not treat 409 as failure. Do not start a second queue to “retry” a processing job.
5. Complete (free, best-effort)
POST /api/v1/video/complete — { queue_id } (model optional/ignored). Skip if you already set delete_media_on_completion on retrieve, or if the result was only a download_url (nothing stored here to delete).
After a successful binary retrieve Venice may have already cleaned the job. This gateway maps that to 200 { "success": true, "alreadyCompleted": true } instead of a 400.
Cost
Charge happens at queue, once Venice has accepted the job. Quote first. If Venice rejects the queue call, the response carries "settled": false and no USDC moves. A job that Venice accepts and that fails later has already been charged. A response with "settled": true and a non-2xx status is a settled-but-undelivered case (Errors).