Skip to main content
POST
Edit an existing image
Models like Nano Banana (Gemini Image) support edits — provide a source image + prompt:

Sample output

Source image before edit

Source image — autumn Japanese garden

Image after edit

Edited: 'Transform this into a snowy winter wonderland — keep the layout intact.' (gemini-2.5-flash-image)

Image-edit output format matches image generation.

Supported models

Image-edit capability is model-dependent. Check capabilities.imageEdit: true via GET /v1/models/{slug} or see Models catalog.

Authorizations

Authorization
string
header
required

API key in format: Bearer inf_***

Body

application/json
model
string
required
prompt
string
required

Edit instruction

image_base64
string
required

Base64-encoded source image

image_mime_type
string
default:image/png
mask_base64
string

Base64-encoded mask (transparent area = edit region)

mask_mime_type
string
default:image/png
n
integer
default:1
size
enum<string>
default:1024x1024
Available options:
256x256,
512x512,
1024x1024,
1792x1024,
1024x1792
response_format
enum<string>
default:url
Available options:
url,
b64_json

Response

Image edit result

created
integer
Example:

1713204900

data
object[]
Example:
credits_used
integer
Example:

40