Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Value: wan25_t2i_preview
input object required
Input data for the generation request.
prompt
stringrequiredPositive prompt used to describe the image content, style, and composition you expect to generate. Supports Chinese and English.
negative_prompt
stringNegative prompt describing what should not appear in the generated image.
parameters object
Image processing parameters
size
stringOutput image resolution in the format
width*height. Total pixels must be between[1280×1280, 1440×1440], and aspect ratio must be in the range[1:4, 4:1]. For example,768×2700meets the requirements.Recommended resolutions for common aspect ratios:
1:1:1280×1280
3:4:1104×1472
4:3:1472×1104
9:16:960×1696
16:9:1696×960Default:
1280×1280
n
integerNumber of images to generate. This parameter directly affects billing costs (Cost = Unit price × Number of images), please confirm model pricing before calling. Recommended to set to
1during testing.Range:
1-4Default:
4
prompt_extend
booleanWhether to enable intelligent Prompt rewriting. When enabled, a large model is used to optimize positive prompts, which has a significant effect on shorter prompts but adds 3–4 seconds of processing time.
Options:
true,falseDefault:
true
watermark
booleanWhether to add a watermark identifier. The watermark is located in the lower right corner of the image with fixed text “AI Generated”.
Options:
false,trueDefault:
false
seed
integerRandom seed for generation. Using the same seed value can keep the generated content relatively stable. If not provided, the algorithm will automatically use a random seed.
Note: The model generation process is probabilistic; even with the same seed, completely consistent results cannot be guaranteed.
Range:
0-2147483647
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Generation results, only present when status is completed
content
arrayList of generated resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
jobId
stringRemote task ID
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information