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": "Nano Banana 2",
"style": "Cyberpunk",
"artist": "Van Gogh",
"dimensions": "1024x1024",
"useHD": false,
"image": "<string>",
"images": "[\"https://media.easy-peasy.ai/a.png\", \"https://media.easy-peasy.ai/b.png\"]",
"outputs": 1,
"resolution": "1K",
"recraftStyle": "any"
}
'import requests
url = "https://easy-peasy.ai/api/generate-image"
payload = {
"prompt": "neon cat",
"model": "Nano Banana 2",
"style": "Cyberpunk",
"artist": "Van Gogh",
"dimensions": "1024x1024",
"useHD": False,
"image": "<string>",
"images": "[\"https://media.easy-peasy.ai/a.png\", \"https://media.easy-peasy.ai/b.png\"]",
"outputs": 1,
"resolution": "1K",
"recraftStyle": "any"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'neon cat',
model: 'Nano Banana 2',
style: 'Cyberpunk',
artist: 'Van Gogh',
dimensions: '1024x1024',
useHD: false,
image: '<string>',
images: '["https://media.easy-peasy.ai/a.png", "https://media.easy-peasy.ai/b.png"]',
outputs: 1,
resolution: '1K',
recraftStyle: 'any'
})
};
fetch('https://easy-peasy.ai/api/generate-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://easy-peasy.ai/api/generate-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'neon cat',
'model' => 'Nano Banana 2',
'style' => 'Cyberpunk',
'artist' => 'Van Gogh',
'dimensions' => '1024x1024',
'useHD' => false,
'image' => '<string>',
'images' => '["https://media.easy-peasy.ai/a.png", "https://media.easy-peasy.ai/b.png"]',
'outputs' => 1,
'resolution' => '1K',
'recraftStyle' => 'any'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/generate-image"
payload := strings.NewReader("{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://easy-peasy.ai/api/generate-image")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/generate-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": 545135,
"image_url": "https://yourcdn.com/generated-image.png",
"model": "Nano Banana 2",
"used_credits": 2,
"prompt": "neon cat"
}
]{
"error": "Invalid input"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Server error"
}Generate Image
Generate images from a prompt, or edit supplied images. model selects the text-to-image generator; editModel selects the editor for Edit Image with AI, and when editModel is omitted, a model that is one of the editModel values selects it instead. API-key requests wait for standard generation results. Check every returned image_url. Premium models and available credits depend on the account plan.
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": "Nano Banana 2",
"style": "Cyberpunk",
"artist": "Van Gogh",
"dimensions": "1024x1024",
"useHD": false,
"image": "<string>",
"images": "[\"https://media.easy-peasy.ai/a.png\", \"https://media.easy-peasy.ai/b.png\"]",
"outputs": 1,
"resolution": "1K",
"recraftStyle": "any"
}
'import requests
url = "https://easy-peasy.ai/api/generate-image"
payload = {
"prompt": "neon cat",
"model": "Nano Banana 2",
"style": "Cyberpunk",
"artist": "Van Gogh",
"dimensions": "1024x1024",
"useHD": False,
"image": "<string>",
"images": "[\"https://media.easy-peasy.ai/a.png\", \"https://media.easy-peasy.ai/b.png\"]",
"outputs": 1,
"resolution": "1K",
"recraftStyle": "any"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'neon cat',
model: 'Nano Banana 2',
style: 'Cyberpunk',
artist: 'Van Gogh',
dimensions: '1024x1024',
useHD: false,
image: '<string>',
images: '["https://media.easy-peasy.ai/a.png", "https://media.easy-peasy.ai/b.png"]',
outputs: 1,
resolution: '1K',
recraftStyle: 'any'
})
};
fetch('https://easy-peasy.ai/api/generate-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://easy-peasy.ai/api/generate-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'neon cat',
'model' => 'Nano Banana 2',
'style' => 'Cyberpunk',
'artist' => 'Van Gogh',
'dimensions' => '1024x1024',
'useHD' => false,
'image' => '<string>',
'images' => '["https://media.easy-peasy.ai/a.png", "https://media.easy-peasy.ai/b.png"]',
'outputs' => 1,
'resolution' => '1K',
'recraftStyle' => 'any'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/generate-image"
payload := strings.NewReader("{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://easy-peasy.ai/api/generate-image")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/generate-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"neon cat\",\n \"model\": \"Nano Banana 2\",\n \"style\": \"Cyberpunk\",\n \"artist\": \"Van Gogh\",\n \"dimensions\": \"1024x1024\",\n \"useHD\": false,\n \"image\": \"<string>\",\n \"images\": \"[\\\"https://media.easy-peasy.ai/a.png\\\", \\\"https://media.easy-peasy.ai/b.png\\\"]\",\n \"outputs\": 1,\n \"resolution\": \"1K\",\n \"recraftStyle\": \"any\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": 545135,
"image_url": "https://yourcdn.com/generated-image.png",
"model": "Nano Banana 2",
"used_credits": 2,
"prompt": "neon cat"
}
]{
"error": "Invalid input"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Server error"
}Generate or edit an image
- Text-to-image — Provide
prompt+model. Themodelpicks the generator (e.g.Nano Banana 2,OpenAI GPT Image 2.5 Flare Medium). - Editing / reference image — Provide
prompt+image(orimages). With no explicitaction, this selects Edit Image with AI. Pick the editor witheditModel, or withmodelwhen it is one of the edit models. Other actions, such as background removal, have their own behavior.
action, the editor is:editModel, when you send it. An unknown value returns a400error.- Otherwise
model, when it is one of theeditModelvalues.model: "Nano Banana Pro"edits with Nano Banana Pro. - Otherwise the default editor, currently
OpenAI GPT Image 2.5 Flare Medium. Amodelthat only generates new images is ignored for edits, so sendeditModelif you’d rather get an error.
action, editModel: "Qwen Image" also selects the default editor; send action: "Edit Image with AI" with it to edit with Qwen Image. With that action and no editModel, the editor is Qwen Image and model isn’t used. Text-to-image defaults to model: "Nano Banana 2".prompt as an instruction about the image (e.g. “change the color to yellow”, “place this product on a marble counter”).
One reference image
curl -X POST https://easy-peasy.ai/api/generate-image \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Place this product on a marble kitchen counter with soft morning light",
"image": "https://yourcdn.com/product.png",
"editModel": "Nano Banana 2",
"dimensions": "1:1"
}'
Multiple reference images
Passimages as a JSON-encoded string array (not a JSON array):
curl -X POST https://easy-peasy.ai/api/generate-image \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Put the person from the first image into the room in the second image",
"images": "[\"https://yourcdn.com/person.png\", \"https://yourcdn.com/room.png\"]",
"editModel": "Nano Banana 2",
"dimensions": "1:1"
}'
Model naming notes
- GPT Image 2 is exposed as three quality tiers — use the exact strings
OpenAI GPT Image 2 Low,OpenAI GPT Image 2 Medium, orOpenAI GPT Image 2 High. There is no bare"GPT Image 2"value. - GPT Image 2.5 uses exact quality names such as
OpenAI GPT Image 2.5 Flare MediumandOpenAI GPT Image 2.5 Sunburst High. The schemas list all available tiers. - New image models include
Nano Banana 2 Lite,Seedream 5.0 Pro,Muse Image,Grok Imagine 2.0,WAN 2.7, and others listed below. The generation and editing lists differ. - Reve is
REVEfor text-to-image (model), andReve/Reve Fastfor editing (editModel). There is no"Reve 2.0". - Model names are matched exactly — always send a value as listed in the schema enums below. An unrecognized
editModelreturns a400error; an unrecognizedmodelmay fall back to a default generator (or, when editing, the default editor), so a typo can silently produce the wrong model.
Read the result
The response is an array of image records. Modern model integrations wait for results when you authenticate with an API key; the web-onlywaitForResult flag does not turn that off. Some legacy integrations, including Midjourney, return pending records with empty image_url values.
Check each record’s image_url. If it is empty, save its id and poll Get Image every 15–30 seconds with the same account’s key. Stop after a bounded timeout and retain the ID. A polling timeout does not cancel generation or justify automatically creating another paid job.
outputs defaults to one, but actual output count depends on the model. Midjourney returns four records per job. Credit amounts can be fractional.
DALL-E 3 and Imagen titles are no longer in this endpoint’s documented catalog. Update older integrations to a listed model instead of relying on fallback behavior.Authorizations
API key for authentication. Get yours at https://easy-peasy.ai/settings/api
Body
The prompt and model to generate the image
The textual description of the image to be generated
"neon cat"
Exact model title. For text-to-image, defaults to Nano Banana 2. With image or images, no action and no editModel, it also selects the editor when it is one of the editModel values; any other model edits with the default editor (currently OpenAI GPT Image 2.5 Flare Medium). Unknown titles may fall back to another generator; use a listed value.
Nano Banana 2 Lite, Nano Banana 2, OpenAI GPT Image 2 Low, OpenAI GPT Image 2 Medium, OpenAI GPT Image 2 High, OpenAI GPT Image 2.5 Flare Low, OpenAI GPT Image 2.5 Flare Medium, OpenAI GPT Image 2.5 Flare High, OpenAI GPT Image 2.5 Sunburst Medium, OpenAI GPT Image 2.5 Sunburst High, Nano Banana Pro, Nano Banana Flash, Z-Image Turbo, ImagineArt 1.5, Mai Image 2.5, Muse Image, FLUX.2 [max], FLUX.2 [flex], FLUX.2 [pro], FLUX.2 [dev], Seedream 4.0, Seedream 4.5, Seedream 5.0 Lite, Seedream 5.0 Pro, Qwen Image Max, Qwen Image 2.0, WAN 2.7 Pro, WAN 2.7, Krea v2 Large, Krea v2 Medium, Krea v2 Medium Turbo, Luma Uni v1, Boogu Image, Cosmos 3 Super, P-Image, HunyuanImage 3.0, REVE, Recraft v4.1, Recraft v4.1 Pro, Recraft v4.1 Vector, Recraft v4.1 Pro Vector, Recraft v3, Stable Diffusion XL, FLUX.1, Stable Diffusion 3.5, Bria 3.2, HiDream, WAN 2.2, WAN 2.5 Preview, Dreamina 3.1, Qwen-Image, Grok Imagine 2.0, Grok, Grok Pro, Kandinsky 3.0, Kandinsky 2.2, Kandinsky 2, MiniMax Image 01, FLUX 1.1 Pro Ultra, Ideogram v4, Ideogram v3, Flux Kontext Pro, Flux Kontext Max, Seedream 3.0, Nano Banana, OpenAI GPT Image 1, OpenAI GPT Image 1.5, Midjourney V6, Midjourney V7, FLUX 1.1 Pro, Flux.1 Krea, Stable Diffusion 3.0 "Nano Banana 2"
Style for the image (e.g. Cyberpunk, Watercolor). Not all models support this parameter.
"Cyberpunk"
Artist style to emulate (e.g. Van Gogh). Not all models support this parameter.
"Van Gogh"
Size or aspect ratio, depending on the selected generator or editor. Nano Banana 2 accepts ratios such as 1:1, 16:9, and 9:16; OpenAI GPT Image accepts sizes such as 1024x1024, 1536x1024, and 1024x1536. Support differs by model. The request default is 1024x1024; send a value appropriate to your chosen model.
"1024x1024"
Use HD quality. Supported by select models.
false
Public input image URL. With no action, selects Edit Image with AI. Choose the editor with editModel, or with model when it is one of the editModel values. For several reference images use images.
JSON-encoded array of reference image URLs, for edit models that accept several inputs (e.g. combine subjects/scenes). Example: "[\"https://.../a.png\", \"https://.../b.png\"]". When set, takes precedence over image.
"[\"https://media.easy-peasy.ai/a.png\", \"https://media.easy-peasy.ai/b.png\"]"
Action to perform on the image. If not specified when image is provided, defaults to Edit Image with AI (which then uses editModel). "Character Reference" / "Style Reference" generate new scenes that keep a subject/style rather than editing the source image.
Edit Image with AI, Remove Background, Replace Background, Colorize, Relight, Stylization, Realistic Photos, Hyper Realistic Photos, Sketch to Image, Ghiblify, Caricature, Muppets, Halloween, Professional Headshot, Character Reference, Consistent Character, Style Reference, Style Reference SD3, Find and Replace, Visualize What Happens Next Editor used with action: Edit Image with AI; takes precedence over model. Without an explicit action, image/images selects this editor; when editModel is omitted, model selects it if model is one of these values, and otherwise the default editor (currently OpenAI GPT Image 2.5 Flare Medium) is used. editModel Qwen Image without an action also selects the default editor; send action: Edit Image with AI to use Qwen Image. With that action, the omitted editModel defaults to Qwen Image. Send editModel explicitly for predictable behavior.
Nano Banana 2 Lite, Nano Banana 2, Nano Banana Pro, Grok, Grok Pro, Grok Imagine 2.0, Muse Image, OpenAI GPT Image 1.5, OpenAI GPT Image 2 Low, OpenAI GPT Image 2 Medium, OpenAI GPT Image 2 High, OpenAI GPT Image 2.5 Flare Low, OpenAI GPT Image 2.5 Flare Medium, OpenAI GPT Image 2.5 Flare High, OpenAI GPT Image 2.5 Sunburst Medium, OpenAI GPT Image 2.5 Sunburst High, Seedream 4.5, Seedream 5.0 Lite, Seedream 5.0 Pro, FLUX.2 [max], FLUX.2 [pro], FLUX.2 [flex], Seedream 4.0, Nano Banana, Qwen Image, Reve, Reve Fast, Mai Image 2.5, Flux Kontext Pro, Flux Kontext Max, OpenAI GPT Image 1, Ideogram v3 Character Number of images to generate.
1
Model-specific image resolution tier (uppercase K). Nano Banana 2 defaults to 1K; Nano Banana Pro/Flash default to 2K. Not every model supports every tier. This does not use the lowercase video resolution values.
0.5K, 1K, 2K, 4K "1K"
Style preset for Recraft v3 model.
"any"
Response
Successful image generation
Unique identifier for the generated image
545135
URL of the generated image
"https://yourcdn.com/generated-image.png"
The model used for the image generation
"Nano Banana 2"
Credits used, which may be fractional.
2
The prompt used for image generation
"neon cat"
Was this page helpful?
