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/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
modelstringRequired. Set to recraft-v4-pro.
publicbooleanOptional. Whether the generation is publicly visible.
parameters.promptstringRequired. Text prompt describing the desired image.
parameters.prompt_enhancestringOptional. "ON" or "OFF".
parameters.quantityintegerOptional. Number of images per request: 1–6; for more than 6 images, send multiple requests.
parameters.widthintegerRequired. Must match the exact sizes for the chosen aspect ratio (see table below).
parameters.heightintegerRequired. 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 RatioWidthHeight
1:120482048
2:130721536
1:215363072
3:225601664
2:316642560
4:324321792
3:417922432
5:423041792
4:517922304
6:1016642688
14:1025601792
10:1417922560
16:926881536
9:1615362688