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-2.0",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic product photo of a glass perfume bottle on black stone, dramatic rim lighting",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1786751400-abcd1234",
"status": "not_started",
"created_time": "2026-08-15T10:30:00"
}
}Grok (xAI)
Grok Imagine Image 2.0 Generation
Image generation and editing with selectable quality and resolution
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-2.0",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A cinematic product photo of a glass perfume bottle on black stone, dramatic rim lighting",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1786751400-abcd1234",
"status": "not_started",
"created_time": "2026-08-15T10: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.
Grok Imagine Image 2.0 Generation
Usegrok-imagine-image-2.0 for text-to-image generation and image editing through one model ID.
When input.image_urls is empty or omitted, the model creates images from the prompt. When input.image_urls contains one to three images, the model edits those images. The default aspect ratio is 1:1.
Use input.quality and input.resolution to control the output tier, and input.n to request up to four output images. Usage depends on the selected output count, quality, resolution, and number of input images.
Available Models
- grok-imagine-image-2.0 - Text-to-image generation and multi-image editing
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
Grok Imagine Image 2.0 model identifier
Available options:
grok-imagine-image-2.0 Generation parameters. Providing image_urls selects image editing; otherwise the request creates images from text.
Show child attributes
Show child attributes
Webhook callback URL for result notifications
Example:
"https://your-domain.com/callback"
