curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "z-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"size": "1:1",
"enable_safety_checker": true
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2025-11-12T10:30:00"
}
}Alibaba
Z-Image Generation
High-quality image generation with unified text-to-image and image editing support
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": "z-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"size": "1:1",
"enable_safety_checker": true
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2025-11-12T10:30:00"
}
}- 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 response result through the unified Query Task Status endpoint.
Z-Image Generation
Generate high-quality images using the Z-Image model. Supports both text-to-image and image editing with a unified request shape.z-image uses a unified request format:
- If
input.image_urlsis omitted, the request is handled as text-to-image - If
input.image_urlsis provided, the request is handled as image editing automatically
Available Model
- z-image - Unified text-to-image and image editing model
Supported Parameters
prompt- Required prompt, max1000characterssize- Required for text-to-image, optional for image editing. Supported values:1:1,4:3,3:4,16:9,9:16image_urls- Optional reference image array for editing, must contain exactly1image URLenable_safety_checker- Optional boolean safety checker switch, defaults totrue
Notes
input.image_urls[0]is used as the edit reference image- When
image_urlsis present,sizecan be omitted
How to Call
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": "z-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"size": "1:1",
"enable_safety_checker": true
}
}'
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "Turn this product photo into a premium studio shot with soft rim lighting",
"image_urls": ["https://example.com/reference-image.png"],
"size": "4:3",
"enable_safety_checker": true
}
}'
Authorizations
All API endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key Management Page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Z-Image model identifier
Available options:
z-image Input parameters for generation. size is required for text-to-image. When image_urls is present, the request is routed to image editing automatically and size becomes optional.
Show child attributes
Show child attributes
Webhook callback URL for result notifications
Example:
"https://your-domain.com/callback"
