Tradução de apoio para consulta. Código e identificadores técnicos preservados. Consultar referência original ↗
Wan 2.7 -- Recuperar resultado da edição de vídeo
Verifique wan2.7 status da tarefa de edição de vídeo
Estratégia de votação
- Envie uma tarefa via Editar um vídeo e salve o retornado
task_id. - Faça pesquisas a cada 15 segundos até
task_statusalcançaSUCCEEDEDouFAILED. - Em caso de sucesso, recupere o vídeo de
video_url.
Notas
- Expiração do URL: download em 24 horas --
video_urlexpira depois disso. - Fluxo de status:
PENDING->RUNNING->SUCCEEDED/FAILED.
OpenAPI
openapi: 3.1.0
info:
title: Wan 2.7 Video Editing API
description: Edit videos using the Wan 2.7 model. Supports multimodal inputs such as text, images, and videos for video editing. Submit a task asynchronously, then poll `GET /tasks/{task_id}` for the result.
version: 1.0.0
servers:
- url: https://maas.qwencloudapi.com/api/v1
description: Singapore
security:
- BearerAuth: []
paths:
/tasks/{task_id}:
get:
operationId: getWan27VideoEditingTaskStatus
summary: Query task result
description: Poll task status and retrieve the result video URL.
parameters:
- name: task_id
in: path
required: true
description: Task ID from the submit response.
schema:
type: string
responses:
"200":
description: Task status retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Wan27VideoEditingTaskStatusResponse"
examples:
SUCCEEDED:
summary: Task succeeded
value:
request_id: f16ae7e9-d518-92f8-a02c-xxxxxx
output:
task_id: 05e68c7e-850c-49e4-b866-xxxxxx
task_status: SUCCEEDED
submit_time: 2026-04-03 00:08:03.576
scheduled_time: 2026-04-03 00:08:13.408
end_time: 2026-04-03 00:11:57.286
orig_prompt: Convert the entire scene to a claymation style
video_url: https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?xxxx
usage:
duration: 10.04
input_video_duration: 5.02
output_video_duration: 5.02
video_count: 1
SR: 720
RUNNING:
summary: Task running
value:
request_id: c1209113-8437-424f-a386-xxxxxx
output:
task_id: 05e68c7e-850c-49e4-b866-xxxxxx
task_status: RUNNING
submit_time: 2026-04-03 00:08:03.576
scheduled_time: 2026-04-03 00:08:13.408
FAILED:
summary: Task failed
value:
request_id: e5d70b02-ebd3-98ce-9fe8-759d7d7b107d
output:
task_id: 86ecf553-d340-4e21-af6e-a0c6a421c010
task_status: FAILED
code: InvalidParameter
message: The size does not match xxxxxx.
UNKNOWN:
summary: Task expired
value:
request_id: a4de7c32-7057-9f82-8581-xxxxxx
output:
task_id: 502a00b1-19d9-4839-a82f-xxxxxx
task_status: UNKNOWN
"400":
description: Invalid request parameters
content:
application/json:
schema:
$ref: "#/components/schemas/DashScopeErrorResponse"
x-codeSamples:
- lang: curl
label: cURL - Query task result
source: |-
# Replace {task_id} with the actual task ID from the submit response
curl -X GET 'https://maas.qwencloudapi.com/api/v1/tasks/{task_id}' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: DashScope API Key. Get one from the [QwenCloud console](https://home.qwencloud.com/api-keys).
schemas:
Wan27VideoEditingRequest:
type: object
required:
- model
- input
properties:
model:
type: string
description: "Model identifier. Fixed value: `wan2.7-videoedit`."
enum:
- wan2.7-videoedit
example: wan2.7-videoedit
input:
type: object
required:
- media
description: Specifies input parameters, such as the prompt.
properties:
prompt:
type: string
description: A text prompt that describes the desired elements and visual features in the generated video. Supports Chinese and English, up to 5,000 characters (auto-truncated if exceeded).
example: Convert the entire scene to a claymation style
negative_prompt:
type: string
description: Describe what to exclude from the video (e.g., `low quality, blurry, extra fingers`). Supports Chinese and English, up to 500 characters (auto-truncated if exceeded).
example: low resolution, error, worst quality, low quality, incomplete, extra fingers, poor proportions
media:
type: array
description: |-
Media materials for editing. Each element has `type` and `url` fields.
- **video** (required; you can provide only one video): The video to edit. Format: MP4, MOV. Duration: 2-10 seconds. Resolution: width and height in [240, 4096] pixels. Aspect ratio: 1:8 to 8:1. Max file size: 100 MB. HTTP/HTTPS URLs only.
- **reference_image** (optional; you can provide a maximum of four reference images): Reference images for style or content transfer. Format: JPEG, JPG, PNG (no alpha channel), BMP, WEBP. Resolution: width and height in [240, 8000] pixels. Aspect ratio: 1:8 to 8:1. Max file size: 20 MB. Supports HTTP/HTTPS URLs and Base64-encoded data (`data:{MIME_type};base64,{base64_data}`).
items:
type: object
required:
- type
- url
properties:
type:
type: string
description: |-
Media type.
- `video`: The video to edit (required, max 1).
- `reference_image`: A reference image (optional, max 4).
enum:
- video
- reference_image
url:
type: string
description: |-
URL or Base64-encoded data.
**For video** (`type=video`): Public URL (HTTP/HTTPS).
**For image** (`type=reference_image`): Public URL (HTTP/HTTPS) or Base64 string in the format `data:{MIME_type};base64,{base64_data}`. Supported MIME types: `image/jpeg`, `image/png`, `image/bmp`, `image/webp`.
parameters:
$ref: "#/components/schemas/Wan27VideoEditingParameters"
Wan27VideoEditingParameters:
type: object
description: Video editing parameters.
properties:
resolution:
type: string
description: |-
Video clarity tier. Higher resolution costs more.
Actual output dimensions depend on `ratio`:
- **720P**: 16:9=1280x720, 9:16=720x1280, 1:1=960x960, 4:3=1104x832, 3:4=832x1104
- **1080P**: 16:9=1920x1080, 9:16=1080x1920, 1:1=1440x1440, 4:3=1648x1248, 3:4=1248x1648
enum:
- 720P
- 1080P
default: 1080P
ratio:
type: string
description: Aspect ratio of the output video. If omitted, uses the input video's aspect ratio.
enum:
- 16:9
- 9:16
- 1:1
- 4:3
- 3:4
duration:
type: integer
description: "Output video duration in seconds. `0` (default): use the input video's full duration without truncation. `2`-`10`: truncate the input video to this length."
maximum: 10
minimum: 0
default: 0
audio_setting:
type: string
description: |-
Audio handling for the output video.
- `auto` (default): The model decides based on `prompt`. If the prompt describes sound, audio may be regenerated; otherwise the original audio is kept.
- `origin`: Always keep the original audio without regeneration.
enum:
- auto
- origin
default: auto
prompt_extend:
type: boolean
description: Rewrite the prompt using a Large Language Model before generation. Improves results for short or vague prompts but adds latency. Set to `false` to use your prompt verbatim.
default: true
watermark:
type: boolean
description: Add an "AI Generated" watermark in the lower-right corner.
default: false
seed:
type: integer
description: Seed for reproducible results. Same seed + same parameters produces similar (not identical) output.
minimum: 0
maximum: 2147483647
AsyncTaskSubmitResponse:
type: object
description: Response from an asynchronous task submission.
properties:
request_id:
type: string
description: Unique request identifier for tracing and troubleshooting.
example: 4909100c-7b5a-9f92-bfe5-xxxxxx
output:
type: object
properties:
task_id:
type: string
description: Task ID for polling status. Use with `GET /tasks/{task_id}`.
example: 0385dc79-5ff8-4d82-bcb6-xxxxxx
task_status:
type: string
description: Initial task status, typically `PENDING`.
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
Wan27VideoEditingTaskStatusResponse:
type: object
description: Response from querying the status of a wan2.7 video editing task.
properties:
request_id:
type: string
description: Unique request identifier for tracing and troubleshooting.
example: f16ae7e9-d518-92f8-a02c-xxxxxx
output:
type: object
properties:
task_id:
type: string
description: Task ID. Queryable for 24 hours after submission.
example: 05e68c7e-850c-49e4-b866-xxxxxx
task_status:
type: string
description: "Task lifecycle: `PENDING` -> `RUNNING` -> `SUCCEEDED` or `FAILED`. `CANCELED` if manually stopped. `UNKNOWN` if expired."
enum:
- PENDING
- RUNNING
- SUCCEEDED
- FAILED
- CANCELED
- UNKNOWN
submit_time:
type: string
description: When the task was submitted (UTC+8, `YYYY-MM-DD HH:mm:ss.SSS`).
example: 2026-04-03 00:08:03.576
scheduled_time:
type: string
description: When the task started running (UTC+8, `YYYY-MM-DD HH:mm:ss.SSS`).
example: 2026-04-03 00:08:13.408
end_time:
type: string
description: When the task finished (UTC+8, `YYYY-MM-DD HH:mm:ss.SSS`). Only present for `SUCCEEDED` or `FAILED` tasks.
example: 2026-04-03 00:11:57.286
orig_prompt:
type: string
description: Your original prompt text before any rewriting by `prompt_extend`.
video_url:
type: string
format: uri
description: URL of the generated video (MP4, H.264 encoding). Only present when `task_status` is `SUCCEEDED`. **Valid for 24 hours** -- download promptly.
example: https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?xxxx
code:
type: string
description: Error code. Only present when `task_status` is `FAILED`.
message:
type: string
description: Error message. Only present when `task_status` is `FAILED`.
usage:
type: object
description: Resource consumption. Only present when `task_status` is `SUCCEEDED`.
properties:
input_video_duration:
type: number
description: Input video duration in seconds.
output_video_duration:
type: number
description: Output video duration in seconds.
duration:
type: number
description: "Billable video duration in seconds. Formula: `input_video_duration + output_video_duration`."
SR:
type: integer
description: Resolution tier of the output video (e.g., `720`).
video_count:
type: integer
description: "Number of videos generated. Fixed value: `1`."
DashScopeErrorResponse:
type: object
description: DashScope API error response.
properties:
request_id:
type: string
description: Unique request identifier for tracing and support.
code:
type: string
description: Error code (e.g., `InvalidParameter`, `Throttling`, `Unauthorized`).
example: InvalidParameter
message:
type: string
description: Human-readable error message.
example: Invalid model name