curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "flux-dev",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic product photo of a matte black smart speaker on a marble table, soft studio lighting",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-06-26T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Flux
Flux Dev
FLUX.1 Dev API 根据提示词生成图像,或编辑恰好一张参考图。文生图支持预设比例、高清正方形或自定义 WIDTHxHEIGHT 尺寸。
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": "flux-dev",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic product photo of a matte black smart speaker on a marble table, soft studio lighting",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-06-26T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
flux-dev 根据提示词生成图像,或提供一个 input.image_urls 元素来编辑已有图像。
用 input.size 设置文生图的输出尺寸,用 input.n 设置输出图像数量,用 input.output_format 设置返回的图像格式。支持的尺寸值为 1:1、1:1 HD、4:3、3:4、16:9 和 9:16;其中 1:1 HD 为高清正方形选项。也支持 1024x1536 这类自定义 WIDTHxHEIGHT 值。图生图任务中,输出由源图像引导,input.size 会被忽略。
模型
- flux-dev - 文生图和单图编辑
授权
所有 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