queue_id, then poll /video/retrieve until the response is video/mp4.
Endpoints
| Endpoint | Purpose | Required |
|---|---|---|
POST /video/quote | Get price in USD before generating | No |
POST /video/queue | Submit generation request | Yes |
POST /video/retrieve | Poll status or download video | Yes |
POST /video/complete | Delete video from storage | No |
Step 1: Queue Generation
Request:model and queue_id - you need them for all subsequent calls.
Step 2: Poll for Completion
Request:| Content-Type | Meaning | Action |
|---|---|---|
application/json | Still processing | Wait 5s, poll again |
video/mp4 | Complete | Response body is the video file |
average_execution_time to estimate remaining wait.
Complete response (200, video/mp4):
Response body is raw binary video data. Save to file.
Step 3: Cleanup (Optional)
Either auto-delete on retrieval:/video/complete after saving:
Complete Example
Request Parameters
Queue Request
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model ID. Use wan-2.5-preview-text-to-video for text-to-video, wan-2.5-preview-image-to-video for image-to-video |
prompt | string | Yes | - | What to generate. Max 2500 chars |
negative_prompt | string | No | "low resolution, error, worst quality, low quality, defects" | What to avoid |
duration | string | Yes | - | "5s" or "10s" |
resolution | string | No | "720p" | "480p", "720p", or "1080p" |
aspect_ratio | string | Conditional | - | Model-dependent. Required for models that expose aspect-ratio options; omit for models that do not support aspect-ratio selection |
audio | boolean | Conditional | true (when supported) | Only valid for models with supportsAudioConfig: true; omit for models without audio config support |
image_url | string | Only for image-to-video | - | URL or base64 data URL of source image |
audio_url | string | Conditional | - | URL or base64 data URL of reference audio for models that support audio input |
/models?type=video for each model’s supported request fields before calling /video/queue.
Quote Request
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model ID to price |
duration | string | Yes | - | "5s" or "10s" |
resolution | string | No | "720p" | "480p", "720p", or "1080p" |
aspect_ratio | string | Conditional | - | Include when the selected model supports or requires aspect-ratio selection |
audio | boolean | Conditional | true (when supported) | Only valid for models with supportsAudioConfig: true |
Retrieve Request
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | From queue response |
queue_id | string | Yes | - | From queue response |
delete_media_on_completion | boolean | No | false | Delete video after successful retrieval |
Complete Request
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | From queue response |
queue_id | string | Yes | From queue response |
Image to Video
For image-to-video models, pass source image viaimage_url. The prompt describes desired motion, not the image content.
Price Quote
Get exact cost before generating. Send only pricing inputs (model, duration, and optional resolution, aspect_ratio, audio):
Request:
Errors
| Status | Returned By | Meaning | Action |
|---|---|---|---|
| 400 | queue, quote, retrieve, complete | Invalid parameters | Check request body against schema |
| 401 | queue, retrieve, complete | Auth failed | Check API key |
| 402 | queue | Insufficient balance | Add funds |
| 404 | retrieve | Media not found (invalid, expired, or deleted) | Verify model/queue_id or re-queue |
| 413 | queue | Payload too large | Reduce image/audio size |
| 422 | queue, retrieve | Content violation | Modify prompt |
| 500 | queue, retrieve, complete | Inference/processing failed | Retry with backoff; contact support if persistent |
| 503 | retrieve | Model at capacity | Retry with backoff |
Polling Strategy
- Poll
/video/retrieveon an interval (for example, every 5 seconds) - If
Content-Typeisapplication/json, status is stillPROCESSING; inspectaverage_execution_timeandexecution_duration(milliseconds) - If
Content-Typeisvideo/mp4, save the response body as your output file - Optional cleanup: set
delete_media_on_completion: trueon retrieve, or call/video/completeafter download - Handle
404as invalid, expired, or deleted media; handle500/503with retries/backoff