Recraft V4 Pro
This guide shows how to generate images using the Recraft V4 Pro model via the Leonardo.AI Production REST API.
Sample Request
curl --location 'https://cloud.leonardo.ai/api/rest/v2/generations' \
--header 'authorization: Bearer {api-key}' \
--header 'content-type: application/json' \
--data '{
"public": false,
"model": "recraft-v4-pro",
"parameters": {
"prompt": "A kangaroo eating pizza on a beach",
"prompt_enhance": "OFF",
"quantity": 2,
"width": 2048,
"height": 2048
}
}'Recipe
API Request Endpoint, Headers, Parameters
Endpoint
https://cloud.leonardo.ai/api/rest/v2/generationsHeaders
--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"Body Parameters
| Parameter | Type | Definition |
|---|---|---|
model | string | Required. Set to recraft-v4-pro. |
public | boolean | Optional. Whether the generation is publicly visible. |
parameters.prompt | string | Required. Text prompt describing the desired image. |
parameters.prompt_enhance | string | Optional. "ON" or "OFF". |
parameters.quantity | integer | Optional. Number of images per request: 1–6; for more than 6 images, send multiple requests. |
parameters.width | integer | Required. Must match the exact sizes for the chosen aspect ratio (see table below). |
parameters.height | integer | Required. Must match the exact sizes for the chosen aspect ratio (see table below). |
Aspect Ratio Settings
Use exactly these sizes for Recraft V4 Pro. Custom resolutions are not supported.
| Aspect Ratio | Width | Height |
|---|---|---|
1:1 | 2048 | 2048 |
2:1 | 3072 | 1536 |
1:2 | 1536 | 3072 |
3:2 | 2560 | 1664 |
2:3 | 1664 | 2560 |
4:3 | 2432 | 1792 |
3:4 | 1792 | 2432 |
5:4 | 2304 | 1792 |
4:5 | 1792 | 2304 |
6:10 | 1664 | 2688 |
14:10 | 2560 | 1792 |
10:14 | 1792 | 2560 |
16:9 | 2688 | 1536 |
9:16 | 1536 | 2688 |
Updated about 1 hour ago
