curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7-image",
"prompt": "A cinematic portrait of a traveler in neon rain",
"num_outputs": 1,
"image_size": "portrait_4_3"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "Invalid request format",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient account balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Wan2.7 Image Generation
- Wan 2.7 image generation and editing model, supporting text-to-image and image editing
- Supports preset sizes and explicit width/height dimension objects
- Asynchronous processing mode, use the returned task ID to query status
- Generated image links are valid for 24 hours, please save them promptly
curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7-image",
"prompt": "A cinematic portrait of a traveler in neon rain",
"num_outputs": 1,
"image_size": "portrait_4_3"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "Invalid request format",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid API key",
"type": "authentication_error"
}
}{
"error": {
"message": "Insufficient account balance",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Parameter validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "Service temporarily unavailable, please try again later",
"type": "service_unavailable"
}
}Authorizations
All APIs require Bearer Token authentication
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
wan-2.7-image: Standard, supports text-to-image and image editing
wan-2.7-image-pro: Pro, supports text-to-image and image editing
"wan-2.7-image"
"wan-2.7-image-pro"
Image generation or editing prompt
Notes:
- Text-to-image mode: describe the desired image content
- Image editing mode: describe the edit instructions for the reference image(s)
- Supports both Chinese and English
- Maximum
2000characters
2000"A cinematic portrait of a traveler in neon rain"
List of reference image URLs
Notes:
- Automatically switches to image editing mode when provided
- Supports 1-4 publicly accessible image URLs
- For multi-image editing, reference them in the prompt as image 1, image 2, etc.
["https://example.com/photo.jpg"]
Number of output images
Notes:
- Text-to-image mode: supports
1-5 - Image editing mode: supports
1-4
1 <= x <= 51
Output image size
Options:
- Preset:
square_hd,square,portrait_4_3,portrait_16_9,landscape_4_3,landscape_16_9 - Explicit dimension object:
{width, height}
square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 "square_hd"
Negative prompt describing content to avoid
500"blurry, low quality"
Random seed for reproducibility
0 <= x <= 214748364742
Whether to enable safety checker
Notes:
- Controls content safety review for both input and output
- Uses model default if not specified
Do not pass this parameter unless necessary.
true
Whether to enable prompt expansion
Notes:
- Only available in image editing mode
- Uses model default if not specified
Do not pass this parameter unless necessary.
true
Response
Task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-uyujaw3d"
Actual model name used
Specific task type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Asynchronous task info
Show child attributes
Show child attributes
Task output type
image "image"