MuseSpark
MuseSpark
Models & toolsVideo models

Wan 2.7 Video API guide

Wan 2.7 Video API: Generate video from text, a first frame, or a first-and-last-frame pair. The current item exposes 720P and 1080P output with optional audio input.

Model overview

Generate video from text, a first frame, or a first-and-last-frame pair. The current item exposes 720P and 1080P output with optional audio input.

API integration

DocumentationValue
API invocation identifierwan-2.7-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 video to generate. Required for text-to-video; optional when frame images are provided.

Length: maximum 5000.

modestringNon-nullConditional

Required for Text to Video, First Frame, First and Last Frames.

Additional requirements depend on other values. See model rules.

Generate text-to-video, first-frame video or first/last-frame video. This item does not expose video editing or reference-video generation.

Allowed values: "reference".

Studio preset: "reference".

image_urlsarray<string>Non-nullConditional

Required for First Frame, First and Last Frames.

Additional requirements depend on other values. See model rules.

One first-frame image, or two images ordered as first frame then last frame. Reference-video generation is not enabled for this item.

Item count: maximum 2.

audio_urlstringNon-nullOptional

Optional WAV/MP3 driving audio for text-to-video or first/last-frame generation.

resolutionstringNon-nullOptional

Output video resolution for generate mode.

Allowed values: "720P", "1080P".

Studio preset: "1080P".

durationintegerNon-nullOptional

Output duration in integer seconds, from 2 to 15.

Value: minimum 2; maximum 15.

Studio preset: 5.

aspect_ratiostringNon-nullOptional

Output aspect ratio for text-to-video. Omit when image_urls is provided; image-to-video follows the source image aspect ratio.

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

negative_promptstringNon-nullOptional

Describe content to avoid in the generated video.

Length: maximum 500.

prompt_extendbooleanNon-nullOptional

Enable automatic expansion of the prompt before generation.

Studio preset: true.

batch_sizeintegerNon-nullOptional

Standard quantity control field. The allowed range for this item is 1-4.

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

Value: minimum 1; maximum 4.

Studio preset: 1.

watermarkbooleanNon-nullOptional

Add a watermark to the generated video.

Studio preset: false.

seedintegerNon-nullOptional

Random seed from 0 to 2147483647. The default is 0.

Value: minimum 0; maximum 2147483647.

Studio preset: 0.

video_urlsarray<string>Non-nullOptional

Compatibility guard: unsupported media must be rejected rather than silently filtered into another generation mode.

Item count: minimum 0; maximum 0.

videostringNon-nullOptional

Compatibility guard: unsupported media must be rejected rather than silently filtered into another generation mode.

Length: minimum 0; maximum 0.

imagestringNon-nullOptional

Compatibility guard: unsupported media must be rejected rather than silently filtered into another generation mode.

Length: minimum 0; maximum 0.

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 Videomode
First Frameimage_urls, mode
First and Last Framesimage_urls, mode
  • When the input mode is Text to Video, provide prompt.
  • When the input mode is Text to Video, provide mode; use reference for mode.
  • When the input mode is First Frame, provide mode; use reference for mode.
  • When mode is "reference", keep image_urls, when supplied, at most 2 items.
  • When mode is "reference" and image_urls is provided, omit aspect_ratio.
  • When the input mode is First Frame, provide image_urls; keep image_urls, when supplied, at least 1 and at most 1 items.
  • When the input mode is First Frame, use reference for mode.
  • When the input mode is First and Last Frames, provide image_urls, mode; use reference for mode; keep image_urls, when supplied, at least 2 and at most 2 items.
  • When the input mode is Text to Video, provide prompt; omit image_urls.
  • When the input mode is First Frame, provide image_urls; keep image_urls, when supplied, at least 1 items.
  • When the input mode is First and Last Frames, provide image_urls; keep image_urls, when supplied, at least 2 items.
  • When image_urls is omitted, provide prompt; keep prompt, when supplied, at least 1.

Parameter meaning

  • Text to Video: Use negative_prompt to describe elements that should not appear in the generated video.
  • Text to Video: prompt_extend enables automatic prompt rewriting. Disable it to use the supplied prompt without that rewriting step.
  • Text to Video: A fixed seed may improve repeatability, but does not guarantee identical output on every run.
  • First Frame, First and Last Frames: Use negative_prompt to describe elements that should not appear in the generated video.
  • First Frame, First and Last Frames: prompt_extend enables automatic prompt rewriting. Disable it to use the supplied prompt without that rewriting step.
  • First Frame, First and Last Frames: A fixed seed may improve repeatability, but does not guarantee identical output on every run.
  • Keep mode set to reference, the only exposed value. Select text, first-frame, or first-and-last-frame generation by supplying the appropriate inputs.
  • For first-and-last-frame generation, provide the first frame followed by the last frame in image_urls. Omit video_urls, video, and image; these fields are disabled in the current contract.

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.

Generate a video from text

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.7-video",
  "parameters": {
    "mode": "reference",
    "seed": 0,
    "duration": 5,
    "watermark": false,
    "batch_size": 1,
    "resolution": "720P",
    "prompt_extend": true,
    "prompt": "A paper boat floats across a calm pond, gentle camera tracking"
  }
}'

Parameters used: mode · seed · duration · watermark · batch_size · resolution · prompt_extend · prompt.

Animate a first frame

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.7-video",
  "parameters": {
    "mode": "reference",
    "seed": 0,
    "duration": 5,
    "watermark": false,
    "batch_size": 1,
    "resolution": "720P",
    "prompt_extend": true,
    "prompt": "The boat moves slowly forward with subtle ripples",
    "image_urls": [
      "https://example.com/boat-first-frame.png"
    ]
  }
}'

Parameters used: mode · seed · duration · watermark · batch_size · resolution · prompt_extend · prompt · image_urls.

Connect a first and last frame

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.7-video",
  "parameters": {
    "mode": "reference",
    "seed": 0,
    "duration": 5,
    "watermark": false,
    "batch_size": 1,
    "resolution": "720P",
    "prompt_extend": true,
    "prompt": "A smooth transition as the boat approaches the bridge",
    "image_urls": [
      "https://example.com/boat-first-frame.png",
      "https://example.com/boat-last-frame.png"
    ]
  }
}'

Parameters used: mode · seed · duration · watermark · batch_size · resolution · prompt_extend · prompt · image_urls.

Output

The intended result is a generated video.

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

A reference-video request fails validation. This item currently supports text and image-frame inputs. Omit video_urls and video; choose a model with declared video-reference support for that workflow.

video_urls · video · image_urls

The end frame is missing. For the first-and-last-frame mode, supply exactly two ordered image_urls.

image_urls

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.