Gemini 2.5 Flash Image Edit (Nano Banana)
Model Overview
Setup your API Key
API Schema
The text prompt describing the content, style, or composition of the image to be generated.
List of URLs or local Base64 encoded images to edit.
The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9.
Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment.
trueThe number of images to generate.
1The same seed and the same prompt given to the same version of the model will output the same image every time.
Allow generation of people.
allow_adultPossible values: Adds a filter level to safety filtering.
block_medium_and_abovePossible values: Add an invisible watermark to the generated images.
falseIf True, the URL to the image will be returned; otherwise, the file will be provided in base64 format.
trueProvider routing override. google runs native Google with no fallback; fal runs the fal.ai mirror; auto (default) uses the Google -> fal.ai fallback chain. Case-insensitive.
autoSuccessful response.
curl --request POST \
--url 'https://api.aimlapi.com/v1/images/generations' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{"model": "google/nano-banana-edit", "prompt": "Describe what you want the model to generate."}'Successful response.
{
"data": [
{
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
"b64_json": null
}
],
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}Quick Example
Last updated
Was this helpful?


