You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-references/image-models/Google/gemini-2.5-flash-image-edit.json
+65-25Lines changed: 65 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@
23
23
"model": {
24
24
"type": "string",
25
25
"enum": [
26
-
"google/gemini-2.5-flash-image-edit"
26
+
"google/nano-banana-edit"
27
27
]
28
28
},
29
29
"prompt": {
@@ -36,31 +36,65 @@
36
36
"type": "string",
37
37
"format": "uri"
38
38
},
39
+
"maxItems": 3,
39
40
"description": "List of URLs or local Base64 encoded images to edit."
40
41
},
42
+
"aspect_ratio": {
43
+
"type": "string",
44
+
"enum": [
45
+
"1:1",
46
+
"9:16",
47
+
"16:9",
48
+
"3:4",
49
+
"4:3"
50
+
],
51
+
"description": "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."
52
+
},
53
+
"enhance_prompt": {
54
+
"type": "boolean",
55
+
"default": true,
56
+
"description": "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."
57
+
},
41
58
"num_images": {
42
-
"type": "number",
43
-
"minimum": 1,
59
+
"type": "integer",
44
60
"maximum": 4,
45
61
"default": 1,
46
62
"description": "The number of images to generate."
47
63
},
48
-
"aspect_ratio": {
64
+
"seed": {
65
+
"type": "integer",
66
+
"minimum": 0,
67
+
"maximum": 4294967295,
68
+
"description": "The same seed and the same prompt given to the same version of the model will output the same image every time."
69
+
},
70
+
"person_generation": {
49
71
"type": "string",
50
72
"enum": [
51
-
"21:9",
52
-
"1:1",
53
-
"4:3",
54
-
"3:2",
55
-
"2:3",
56
-
"5:4",
57
-
"4:5",
58
-
"3:4",
59
-
"16:9",
60
-
"9:16"
73
+
"dont_allow",
74
+
"allow_adult"
61
75
],
62
-
"default": "1:1",
63
-
"description": "The aspect ratio of the generated image."
76
+
"default": "allow_adult",
77
+
"description": "Allow generation of people."
78
+
},
79
+
"safety_setting": {
80
+
"type": "string",
81
+
"enum": [
82
+
"block_low_and_above",
83
+
"block_medium_and_above",
84
+
"block_only_high"
85
+
],
86
+
"default": "block_medium_and_above",
87
+
"description": "Adds a filter level to safety filtering."
88
+
},
89
+
"add_watermark": {
90
+
"type": "boolean",
91
+
"default": false,
92
+
"description": "Add an invisible watermark to the generated images."
93
+
},
94
+
"convert_base64_to_url": {
95
+
"type": "boolean",
96
+
"default": true,
97
+
"description": "If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format."
64
98
},
65
99
"provider": {
66
100
"type": "string",
@@ -70,10 +104,9 @@
70
104
},
71
105
"required": [
72
106
"model",
73
-
"prompt",
74
-
"image_urls"
107
+
"prompt"
75
108
],
76
-
"title": "google/gemini-2.5-flash-image-edit"
109
+
"title": "google/nano-banana-edit"
77
110
}
78
111
}
79
112
}
@@ -119,10 +152,16 @@
119
152
"type": "number",
120
153
"description": "The number of tokens consumed during generation.",
121
154
"example": 120000
155
+
},
156
+
"usd_spent": {
157
+
"type": "number",
158
+
"description": "The total amount of money spent by the user in USD.",
159
+
"example": 0.06
122
160
}
123
161
},
124
162
"required": [
125
-
"credits_used"
163
+
"credits_used",
164
+
"usd_spent"
126
165
]
127
166
}
128
167
},
@@ -131,22 +170,23 @@
131
170
}
132
171
}
133
172
}
134
-
}
173
+
},
174
+
"description": "Successful response."
135
175
}
136
176
},
137
177
"x-hideTryItPanel": true,
138
178
"x-codeSamples": [
139
179
{
140
180
"lang": "cURL",
141
-
"source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n\"model\": \"google/gemini-2.5-flash-image-edit\",\n\"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n\"image_urls\": [\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n}'"
181
+
"source": "curl --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\"model\": \"google/nano-banana-edit\",\"prompt\": \"Describe what you want the model to generate.\"}'"
142
182
},
143
183
{
144
184
"lang": "JavaScript",
145
-
"source": "async function main() {\nconst response = await fetch('https://api.aimlapi.com/v1/images/generations', {\nmethod: 'POST',\nheaders: {\n'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n'Content-Type': 'application/json',\n},\nbody: JSON.stringify({\n\"model\": \"google/gemini-2.5-flash-image-edit\",\n\"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n\"image_urls\": [\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n}),\n});\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
185
+
"source": "const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n\"model\": \"google/nano-banana-edit\",\n\"prompt\": \"Describe what you want the model to generate.\"\n}),\n});\n\nconsole.log(await response.json());"
146
186
},
147
187
{
148
188
"lang": "Python",
149
-
"source": "import requests\n\nresponse = requests.post(\n\"https://api.aimlapi.com/v1/images/generations\",\n headers={\n\"Content-Type\":\"application/json\",\n\"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n\"model\": \"google/gemini-2.5-flash-image-edit\",\n\"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n\"image_urls\": [\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n\"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n }\n)\n\ndata = response.json()\nprint(data)"
189
+
"source": "import requests\n\nresponse = requests.post(\n\"https://api.aimlapi.com/v1/images/generations\",\n headers={\n\"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n\"Content-Type\":\"application/json\",\n },\n json={'model': 'google/nano-banana-edit', 'prompt': 'Describe what you want the model to generate.'},\n)\n\nprint(response.json())"
0 commit comments