curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "grok-imagine-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"size": "16:9"
}
}
'{
"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": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Grok (xAI)
Grok Imagine Image
Grok Imagine Image API 根据文本生成图像,或编辑单张参考图。支持的宽高比为 2:3、3:2、1:1、16:9 和 9:16。
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": "grok-imagine-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"size": "16:9"
}
}
'{
"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": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
input.image_urls 必填,且必须是只包含一个 URL 字符串的数组,指向参考图。请提供已上传文件的 URL;支持的类型:image/jpeg、image/png、image/webp;最大大小:10.0MB。
两种模式下 input.size 均为可选。支持的值:2:3、3:2、1:1、16:9、9:16。
模型
- grok-imagine-image - 文生图和图生图
授权
所有 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