curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7-image-pro",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic portrait of a traveler in golden sunset light",
"size": "1024x1024",
"n": 1,
"seed": 12345
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2025-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 401,
"error": {
"message": "Unauthorized - Invalid API key",
"type": "authentication_error"
}
}Alibaba
Wan-2.7-Image-Pro
The Wan 2.7 Image Pro API generates or edits images, using up to four reference images and up to four outputs. Size can be a listed preset or a custom width and height.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-2.7-image-pro",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic portrait of a traveler in golden sunset light",
"size": "1024x1024",
"n": 1,
"seed": 12345
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2025-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 401,
"error": {
"message": "Unauthorized - Invalid API key",
"type": "authentication_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the result through the unified Query Task Status endpoint.
wan-2.7-image-pro is a high-quality image model for generation and editing.
It uses a unified request shape:
- If
input.image_urlsis omitted, the request is handled as text-to-image - If
input.image_urlsis provided, the request is handled as edit mode automatically
Models
- wan-2.7-image-pro - Unified text-to-image and image editing model
Required parameters
prompt- Required prompt
Optional parameters
size- Output image size preset, or a custom{ width, height }objectn- Number of images,1-4seed- Optional random seedimage_urls- Reference images for editing,1-4images required. Order matters: reference them as image 1, image 2, image 3, image 4 in the prompt
Size
input.size supports these preset values:
512x5121024x1024768x10241024x768576x10241024x576
1024x1024
Custom Size
For custom image sizes, you can passwidth and height as an object:
"size": {
"width": 1280,
"height": 720
}
Examples
Use the unified submit endpoint:POST /api/generate/submit
Text-to-image example:
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan-2.7-image-pro",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic portrait of a traveler in golden sunset light",
"size": "1024x1024",
"n": 1,
"seed": 12345
}
}'
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan-2.7-image-pro",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "Turn the scene into a snowy night with neon reflections",
"image_urls": ["https://example.com/reference1.jpg"],
"size": "1024x576",
"n": 2
}
}'
{
"model": "wan-2.7-image-pro",
"input": {
"prompt": "A dramatic fashion editorial scene",
"size": {
"width": 1280,
"height": 720
},
"n": 1
}
}
Authorizations
All API endpoints require Bearer Token authentication.
Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Response
Task submitted successfully
Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.
200: Success400: Invalid request parameters401: Missing or invalid API key402: Insufficient credits403: Permission denied404: Resource not found408: Request timeout429: Rate limit exceeded500: Internal server error502: Upstream service error503: Service unavailable
See Error Codes for details.
Available options:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 Example:
200