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
Wan 2.7 Image Pro API 生成或编辑图像,最多使用四张参考图,最多输出四张图像。尺寸可为列出的预设值或自定义宽高。
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"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
wan-2.7-image-pro 是一款用于生成和编辑的高质量图像模型。
它使用统一的请求结构:
- 省略
input.image_urls时,请求按文生图处理 - 提供
input.image_urls时,请求自动按编辑模式处理
模型
- wan-2.7-image-pro - 统一的文生图与图像编辑模型
必填参数
prompt- 必填提示词
可选参数
size- 输出图像尺寸预设,或自定义{ width, height }对象n- 图像数量,1-4seed- 可选随机种子image_urls- 用于编辑的参考图,需要1-4张。顺序有意义:在提示词中按 image 1、image 2、image 3、image 4 引用它们
尺寸
input.size 支持以下预设值:
512x5121024x1024768x10241024x768576x10241024x576
1024x1024
自定义尺寸
如需自定义图像尺寸,可以以对象形式传入width 和 height:
"size": {
"width": 1280,
"height": 720
}
示例
使用统一提交接口:POST /api/generate/submit
文生图示例:
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
}
}
授权
所有 API 接口都需要 Bearer Token 认证。
创建 API Key:登录 PoYo,进入 仪表盘 → API 密钥(poyo.ai/zh/dashboard/api-key),点击创建 Key。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
响应
任务提交成功
Show child attributes
Show child attributes