典名词元DMTOKENSHome
API DocumentationThird-Party Tools Tutorial
AI Model APIVideoWanxiang

Text-to-Video 2.7

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

X-DashScope-Async*string

Configuration parameters for asynchronous processing. HTTP requests only support asynchronous processing and must be set to enable.

Request Body

application/json

model*string

Model name, fixed value: wan2.7-t2v

Value in"wan2.7-t2v"
input*object

Basic input information, such as prompts.

prompt*string

Text prompt. Used to describe the desired elements and visual characteristics to be included in the generated image. Supports both Chinese and English, where each Chinese character or letter counts as one character, and any excess is automatically truncated. Length limits vary by model version: wan2.7-t2v: up to 5,000 characters.

negative_prompt?string

Negative prompts are used to describe unwanted content in the video frames, allowing you to restrict the visual output. Supports both Chinese and English, with a maximum length of 500 characters; any excess will be automatically truncated. Example values: low resolution, errors, worst quality, low quality, deformed, extra fingers, bad proportions, etc.

audio_url?string

The URL of the audio file, which the model will use to generate a video.

parameters*object

Video processing parameters, such as setting video resolution, setting video duration, enabling intelligent prompt rewriting, and adding watermarks.

resolution?string

Resolution tier for the generated video, used to control video clarity (total pixels). wan2.7-t2v: Valid values: 720P, 1080P. Default value: 1080P.

ratio?string

Aspect ratio of the generated video. 16:9 (default) 9:16 1:1 4:3 3:4 Output video resolutions for different aspect ratios (width and height in pixels) 720P: 16:9: 1280720 9:16: 7201280 1:1: 960960 4:3: 1104832 3:4: 8321104 1080P 16:9: 19201080 9:16: 10801920 1:1: 14401440 4:3: 16481248 3:4: 12481648

duration?integer

Duration of the generated video, in seconds. wan2.7-t2v: An integer in the range [2, 15]. The default value is 5.

prompt_extend?boolean

Whether to enable intelligent prompt rewriting. When enabled, a large model intelligently rewrites the input prompt. This significantly improves generation quality for shorter prompts but increases latency. true: Default value, enables intelligent rewriting. false: Disables intelligent rewriting.

watermark?string

Specifies whether to add a watermark. The watermark is located in the bottom right corner of the video with the fixed text AI-generated. false: Default value, no watermark is added. true: Add a watermark.

seed?string

Random seed, with a value range of [0, 2147483647].

Response Body

application/json

Success

TypeScript Definitions

Use the response body type in TypeScript.

code*integer

Status Code

data*object

Data Object

urls*array<string>

Result Set

[]?string
usage*object

Usage Information

images*integer

Image Count

seconds*integer

Video Duration in Seconds

input_tokens*integer

Input Token Count

total_tokens*integer

Total Tokens

output_tokens*integer

Output Token Count

expired*string

Validity Period

task_id*string

Task ID

task_status*string

Task Status

message*string

Status Information

request_id*string

Request ID

curl -X POST "https://api.ygw.ai/api/v1/video/generation" \  -H "Authorization: string" \  -H "X-DashScope-Async: string" \  -H "Content-Type: application/json" \  -d '{    "model": "wan2.7-t2v",    "input": {      "prompt": "string"    },    "parameters": {}  }'
{
  "code": 0,
  "data": {
    "urls": [
      "string"
    ],
    "usage": {
      "images": 0,
      "seconds": 0,
      "input_tokens": 0,
      "total_tokens": 0,
      "output_tokens": 0
    },
    "expired": "string",
    "task_id": "string",
    "task_status": "string"
  },
  "message": "string",
  "request_id": "string"
}