Skip to main content
POST
/
api
/
generate-image
Generate Image
curl --request POST \
  --url https://easy-peasy.ai/api/generate-image \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": "neon cat",
  "model": "DALL-E 3",
  "style": "Cyberpunk",
  "artist": "Van Gogh",
  "dimensions": "1024x1024",
  "useHD": false,
  "image": "<string>",
  "outputs": 1,
  "resolution": "1K",
  "recraftStyle": "any",
  "waitForResult": false
}
'
[
  {
    "id": 545135,
    "image_url": "https://fdczvxmwwjwpwbeeqcth.supabase.co/storage/v1/object/public/images/27feb2bb-aeb4-4a83-9fb6-8f3f2a15885e/138c3903-2355-4489-8ccf-b4bdade6289a.png",
    "model": "DALL-E 3",
    "used_credits": 2,
    "prompt": "neon cat"
  }
]

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours at https://easy-peasy.ai/settings/api

Headers

x-api-key
string
required

Your API key

Body

application/json

The prompt and model to generate the image

prompt
string
required

The textual description of the image to be generated

Example:

"neon cat"

model
enum<string>
required

The model to use for image generation

Available options:
DALL-E 3,
OpenAI GPT Image 1,
OpenAI GPT Image 1.5,
Midjourney V6,
Midjourney V7,
FLUX.1,
FLUX 1.1 Pro,
FLUX 1.1 Pro Ultra,
FLUX.2 [dev],
FLUX.2 [flex],
FLUX.2 [pro],
FLUX.2 [max],
Flux Kontext Pro,
Flux Kontext Max,
Flux.1 Krea,
Stable Diffusion XL,
Stable Diffusion 3.0,
Stable Diffusion 3.5,
Imagen 3,
Imagen 4,
Imagen 4 Ultra,
Imagen 4 Fast,
Seedream 3.0,
Seedream 4.0,
Seedream 4.5,
Seedream 5.0 Lite,
Recraft v3,
REVE,
ImagineArt 1.5,
HiDream,
HunyuanImage 3.0,
Bria 3.2,
Dreamina 3.1,
Qwen-Image,
Grok,
Grok Pro,
Ideogram v3,
MiniMax Image 01,
WAN 2.2,
WAN 2.5 Preview,
Nano Banana,
Nano Banana 2,
Nano Banana Pro,
Nano Banana Flash,
Z-Image Turbo
Example:

"DALL-E 3"

style
string

Style for the image (e.g. Cyberpunk, Watercolor). Not all models support this parameter.

Example:

"Cyberpunk"

artist
string

Artist style to emulate (e.g. Van Gogh). Not all models support this parameter.

Example:

"Van Gogh"

dimensions
string

Dimensions of the generated image. Accepted values vary by model:

  • DALL-E 3: 1024x1024, 1792x1024, 1024x1792
  • OpenAI GPT Image 1/1.5: 1024x1024, 1536x1024, 1024x1536
  • Midjourney V6/V7, FLUX.1, FLUX 1.1 Pro/Ultra: 1:1, 2:3, 3:2, 4:5, 5:4, 16:9, 9:16
  • FLUX.2 [dev/flex/pro/max]: 1:1, 2:3, 3:2, 4:5, 5:4, 16:9, 9:16
  • Flux Kontext Pro/Max, Stable Diffusion 3.0/3.5: 1:1, 21:9, 16:9, 4:3, 3:2, 2:3, 3:4, 9:16, 9:21
  • Imagen 3/4/4 Ultra/4 Fast, Seedream, HiDream, Dreamina, HunyuanImage, MiniMax, WAN, ImagineArt, Ideogram v3, Qwen-Image: 1:1, 3:4, 4:3, 9:16, 16:9
  • Grok/Grok Pro: 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 1:2, 2:1
  • Recraft v3: 1024x1024, 1365x1024, 1024x1365, 1536x1024, 1024x1536, 1820x1024, 1024x1820, 2048x1024, 1024x2048
  • Nano Banana/Pro/Flash: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
  • Nano Banana 2: same as above plus 1:4, 4:1, 1:8, 8:1
  • REVE: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9
  • Bria 3.2: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9
  • Z-Image Turbo: 1:1, 4:3, 3:4, 16:9, 9:16
  • Stable Diffusion XL: 1024x1024, 2048x1536, 1536x2048
Example:

"1024x1024"

useHD
boolean
default:false

Use HD quality. Supported by select models.

Example:

false

image
string

Image URL for Image-to-Image generations. Provide a source image to edit or transform.

outputs
integer
default:1

Number of images to generate.

Example:

1

resolution
enum<string>

Resolution quality level. Supported by FLUX.2, Nano Banana, and other select models.

Available options:
1K,
2K
Example:

"1K"

recraftStyle
string
default:any

Style preset for Recraft v3 model.

Example:

"any"

waitForResult
boolean
default:false

Wait for the image to be fully generated before returning the response. If false, returns immediately with a pending status.

Example:

false

Response

Successful image generation

id
integer

Unique identifier for the generated image

Example:

545135

image_url
string

URL of the generated image

Example:

"https://fdczvxmwwjwpwbeeqcth.supabase.co/storage/v1/object/public/images/27feb2bb-aeb4-4a83-9fb6-8f3f2a15885e/138c3903-2355-4489-8ccf-b4bdade6289a.png"

model
string

The model used for the image generation

Example:

"DALL-E 3"

used_credits
integer

The number of credits used for the generation

Example:

2

prompt
string

The prompt used for image generation

Example:

"neon cat"