MuseSpark
MuseSpark
Models & toolsVideo models

Wan 2.2 Video API guide

Wan 2.2 Video API: Generate video from text or an image with Wan 2.2 Video. Use the selected mode's input field and this item's resolution, duration, and negative-prompt controls.

Model overview

Generate video from text or an image with Wan 2.2 Video. Use the selected mode's input field and this item's resolution, duration, and negative-prompt controls.

API integration

DocumentationValue
API invocation identifierwan-2.2-video
IntegrationAsync task API

Use this invocation identifier in API requests. Check your authorized model catalog for access. Follow the Quickstart for your first complete call.

Request parameters

Select a mode to highlight its required inputs. Mode selection does not change the API field names.

Studio presets describe the form setup, not guaranteed server defaults. Send preset values explicitly to reproduce them.

promptstringNon-nullConditional

Additional requirements depend on other values. See model rules.

Describe the generated video. Required for text/reference generation; optional for first-frame image generation.

imagestringNon-nullConditional

Required for Image to Video.

Additional requirements depend on other values. See model rules.

Upload the image that guides the generated video.

Media types: image/*.

image_urlsarray<string>Non-nullOptional

Reference inputs are not supported by Wan 2.2. This compatibility field accepts an empty list only.

Item count: minimum 0; maximum 0.

video_urlsarray<string>Non-nullOptional

Reference inputs are not supported by Wan 2.2. This compatibility field accepts an empty list only.

Item count: minimum 0; maximum 0.

resolutionstringNon-nullOptional

Choose the output video resolution.

Allowed values: "480p", "1080p".

Studio preset: "480p".

durationintegerNon-nullOptional

Fixed output duration: 5 seconds.

Allowed values: 5.

Value: minimum 5; maximum 5.

Studio preset: 5.

aspect_ratiostringNon-nullOptional

Text-to-video aspect ratio. Image-to-video follows the source image aspect ratio.

Allowed values: "16:9", "9:16", "1:1", "4:3", "3:4".

Studio preset: "16:9".

negative_promptstringNon-nullOptional

Sets negative prompt for this item.

batch_sizeintegerNon-nullOptional

Sets batch size for this item.

Repeats MuseSpark execution within one logical task. This is separate from a model-native output count.

Value: minimum 1; maximum 4.

Studio preset: 1.

No parameters match. Clear the search or reset the filters.

Model rules

Input modes

Select a mode by supplying its required public inputs. The mode identifier describes a documentation/form choice; do not send input_mode as a model parameter.

ModeRequired inputs
Text to VideoNo reference media required
Image to Videoimage
  • When resolution is "480p" and image is omitted, use 16:9, 9:16, 1:1 for aspect_ratio.
  • When image is provided, use 16:9 for aspect_ratio.
  • When the input mode is Text to Video, omit image.
  • When the input mode is Text to Video, provide prompt; omit image; omit image_urls; omit video_urls.
  • When the input mode is Image to Video, provide image; keep image, when supplied, at least 1.
  • When image is omitted and image_urls is omitted and video_urls is omitted, provide prompt; keep prompt, when supplied, at least 1.

batch_size controls repeated MuseSpark executions. Output grouping, sequential image generation, and video shot count are separate concepts.

Request examples

Replace example media URLs and YOUR_... input identifiers with your own valid resources. Examples are checked against the exported item schema; media access and paid execution are separate runtime checks.

Set MUSESPARK_API_KEY and a stable MUSESPARK_REQUEST_ID before submitting. Preserve the request ID for retries of the same request and use a new ID for new work. Python examples use requests; JavaScript examples use Node.js 20 or later. The standalone Quickstart includes task polling and recovery.

Text to Video

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "wan-2.2-video",
  "parameters": {
    "duration": 5,
    "batch_size": 1,
    "resolution": "480p",
    "aspect_ratio": "16:9",
    "prompt": "A paper city under soft morning light"
  }
}'

Parameters used: duration · batch_size · resolution · aspect_ratio · prompt.

Image to Video

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "wan-2.2-video",
  "parameters": {
    "duration": 5,
    "batch_size": 1,
    "resolution": "480p",
    "aspect_ratio": "16:9",
    "prompt": "A paper city under soft morning light",
    "image": "YOUR_IMAGE"
  }
}'

Parameters used: duration · batch_size · resolution · aspect_ratio · prompt · image.

Output

Creation returns a task ID inside data. Poll that task until completion, then save data.result.output_urls and any data.result.batch_results. See the task lifecycle for terminal states, result retention, and errors.

Troubleshooting

For rejected inputs, check the field type, accepted values, and conditional requirements in Request parameters and Model rules. Correct the affected fields before submitting again.

If creation times out, preserve the request identity and any known task ID. Follow Errors, timeouts and retries before submitting again.

The public input snapshot was exported on 2026-11-09. Current prices and availability are listed in the model center.