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
"description": "The base64-encoded JSON of the generated image.",
82
+
"example": null
83
+
}
84
+
}
85
+
},
86
+
"description": "The list of generated images."
87
+
},
88
+
"meta": {
89
+
"type": "object",
90
+
"nullable": true,
91
+
"properties": {
92
+
"usage": {
93
+
"type": "object",
94
+
"nullable": true,
95
+
"properties": {
96
+
"tokens_used": {
97
+
"type": "number",
98
+
"description": "The number of tokens consumed during generation.",
99
+
"example": 120000
100
+
}
101
+
},
102
+
"required": [
103
+
"tokens_used"
104
+
]
105
+
}
106
+
},
107
+
"description": "Additional details about the generation."
108
+
}
109
+
}
110
+
}
111
+
}
112
+
}
113
+
}
114
+
},
115
+
"x-hideTryItPanel": true,
116
+
"x-codeSamples": [
117
+
{
118
+
"lang": "JavaScript",
119
+
"source": "async function main() {\n 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/gemini-3-pro-image-preview-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();"
120
+
},
121
+
{
122
+
"lang": "Python",
123
+
"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-3-pro-image-preview-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)"
124
+
},
125
+
{
126
+
"lang": "cURL",
127
+
"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-3-pro-image-preview-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 }'"
128
+
},
129
+
{
130
+
"lang": "HTTP",
131
+
"source": "POST /v1/images/generations HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n\"model\": \"google/gemini-3-pro-image-preview-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}"
132
+
}
133
+
]
134
+
}
135
+
},
136
+
"/images/generations": {
137
+
"post": {
138
+
"operationId": "_images_generations",
139
+
"requestBody": {
140
+
"required": true,
141
+
"content": {
142
+
"application/json": {
143
+
"schema": {
144
+
"type": "object",
145
+
"properties": {
146
+
"model": {
147
+
"type": "string",
148
+
"enum": [
149
+
"google/gemini-3-pro-image-preview-edit"
150
+
]
151
+
},
152
+
"prompt": {
153
+
"type": "string",
154
+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
155
+
},
156
+
"image_urls": {
157
+
"type": "array",
158
+
"items": {
159
+
"type": "string",
160
+
"format": "uri"
161
+
},
162
+
"description": "List of URLs or local Base64 encoded images to edit."
163
+
},
164
+
"num_images": {
165
+
"type": "number",
166
+
"minimum": 1,
167
+
"maximum": 4,
168
+
"default": 1,
169
+
"description": "The number of images to generate."
170
+
}
171
+
},
172
+
"required": [
173
+
"model",
174
+
"prompt",
175
+
"image_urls"
176
+
],
177
+
"title": "google/gemini-3-pro-image-preview-edit"
178
+
}
179
+
}
180
+
}
181
+
},
182
+
"responses": {
183
+
"200": {
184
+
"content": {
185
+
"application/json": {
186
+
"schema": {
187
+
"type": "object",
188
+
"properties": {
189
+
"data": {
190
+
"type": "array",
191
+
"nullable": true,
192
+
"items": {
193
+
"type": "object",
194
+
"properties": {
195
+
"url": {
196
+
"type": "string",
197
+
"nullable": true,
198
+
"description": "The URL where the file can be downloaded from.",
"description": "The base64-encoded JSON of the generated image.",
205
+
"example": null
206
+
}
207
+
}
208
+
},
209
+
"description": "The list of generated images."
210
+
},
211
+
"meta": {
212
+
"type": "object",
213
+
"nullable": true,
214
+
"properties": {
215
+
"usage": {
216
+
"type": "object",
217
+
"nullable": true,
218
+
"properties": {
219
+
"tokens_used": {
220
+
"type": "number",
221
+
"description": "The number of tokens consumed during generation.",
222
+
"example": 120000
223
+
}
224
+
},
225
+
"required": [
226
+
"tokens_used"
227
+
]
228
+
}
229
+
},
230
+
"description": "Additional details about the generation."
231
+
}
232
+
}
233
+
}
234
+
}
235
+
}
236
+
}
237
+
},
238
+
"x-hideTryItPanel": true,
239
+
"x-codeSamples": [
240
+
{
241
+
"lang": "JavaScript",
242
+
"source": "async function main() {\n 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/gemini-3-pro-image-preview-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();"
243
+
},
244
+
{
245
+
"lang": "Python",
246
+
"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-3-pro-image-preview-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)"
247
+
},
248
+
{
249
+
"lang": "cURL",
250
+
"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-3-pro-image-preview-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 }'"
251
+
},
252
+
{
253
+
"lang": "HTTP",
254
+
"source": "POST /v1/images/generations HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n\"model\": \"google/gemini-3-pro-image-preview-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}"
0 commit comments