curl --request POST \
--url https://api.loova.ai/api/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt_image_2",
"prompt": "A small orange cat beside a green plant",
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "low",
"output_format": "png",
"count": 1
}
'{
"code": 200,
"trace_id": "45c30d76f06549b199a3775544523689",
"message": null,
"data": {
"task_id": "record_id",
"status": "running",
"created_at": "2026-07-15T12:00:00Z",
"credits_cost": 2
}
}{
"code": 123,
"trace_id": "<string>",
"message": "<string>",
"data": {}
}{
"code": 123,
"trace_id": "<string>",
"message": "<string>",
"data": {}
}Create Image Task
Creates an asynchronous text-to-image or image-to-image generation task.
Model-specific parameters for grok_imagine_image:
image_urls: omit for text-to-image; provide 1 to 3 publicly accessible URLs for image-to-imageaspect_ratio:2:1,20:9,19.5:9,16:9,4:3,3:2,1:1,2:3,3:4,9:16,9:19.5,9:20, or1:2;automaps to1:1for text-to-image and preserves the first input ratio for image-to-imageresolution:1Kor2K; default1Koutput_format:jpeg,png, orwebp; defaultjpegquality: unsupported and ignoredcount: 1 to 4; default 1
curl --request POST \
--url https://api.loova.ai/api/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt_image_2",
"prompt": "A small orange cat beside a green plant",
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "low",
"output_format": "png",
"count": 1
}
'{
"code": 200,
"trace_id": "45c30d76f06549b199a3775544523689",
"message": null,
"data": {
"task_id": "record_id",
"status": "running",
"created_at": "2026-07-15T12:00:00Z",
"credits_cost": 2
}
}{
"code": 123,
"trace_id": "<string>",
"message": "<string>",
"data": {}
}{
"code": 123,
"trace_id": "<string>",
"message": "<string>",
"data": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Validation rules:
- Requests must use
application/json; multipart file upload is not supported modeland a non-emptypromptare requiredimage_urlsmust contain publicly accessible HTTP or HTTPS image URLs;grok_imagine_imageaccepts at most 3- An empty
image_urlsarray creates a text-to-image task; a non-empty array creates an image-to-image task aspect_ratiodefaults toauto; Grok text-to-image maps it to1:1, while Grok image-to-image preserves the first input ratiogrok_imagine_imagesupports only1Kand2Kresolutionqualitydefaults tolowforgpt_image_2;autois accepted as an alias forlow; other models ignore itoutput_formatmust bejpeg,png, orwebp; it is supported bygpt_image_2(defaultpng) andgrok_imagine_image(defaultjpeg)
Image model to use. Each model has different parameter support; see the model-specific parameter rules in this operation's description.
gpt_image_2, nano_banana_2_lite, nano_banana_2, nano_banana_pro, gemini_25_flash_image, grok_imagine_image Text instruction for image generation or editing.
1Publicly accessible HTTP or HTTPS input image URLs. Omit or pass an empty array for text-to-image. gpt_image_2 accepts up to 16 images; grok_imagine_image accepts up to 3 images. Multipart file upload is not supported.
16Output aspect ratio. Supported values vary by model. For grok_imagine_image, auto resolves to 1:1 for text-to-image and preserves the first input image ratio for image-to-image.
auto, 9:16, 2:3, 3:4, 4:5, 1:1, 5:4, 4:3, 3:2, 16:9, 20:9, 19.5:9, 21:9, 9:21, 9:19.5, 9:20, 1:2, 2:1, 1:4, 4:1, 1:8, 8:1 Output resolution. nano_banana_2_lite and gemini_25_flash_image support only 1K; grok_imagine_image supports 1K and 2K; the other models support 1K, 2K, and 4K.
1K, 2K, 4K Output quality for gpt_image_2. Defaults to low when omitted. auto is accepted as a backward-compatible alias for low. Other models ignore this field.
auto, low, medium, high Output image format. Supported by gpt_image_2 (default png) and grok_imagine_image (default jpeg). Other models must omit this field.
jpeg, png, webp Number of output images.
1 <= x <= 4